subsonic3

SubSonic 3 and MySQL, removing underscore from column name in CleanUp() method causes exceptions when using property in linq-query

扶醉桌前 提交于 2019-12-19 11:58:18
问题 I've run into a problem when using SubSonic 3(.0.0.3) ActiveRecord with MySQL. Since MySQL doesn't allow you to use uppercase letters in table or column names (or rather disregards it if you do) I decided to separate words using underscores, e.g. entity_id, and then use the CleanUp() method to add title casing and remove the underscores. A friend wrote a ToTitleCase(string s) method that looks like this: string ToTitleCase(string s) { CultureInfo cultureInfo = Thread.CurrentThread

Relationships and Lazy Loading in SubSonic 3.0

做~自己de王妃 提交于 2019-12-17 19:46:08
问题 I'm playing around with SubSonic 3.0 at the moment, and it looks really straight-forward (except that I still have to decide between SimpleRepository and ActiveRecord, but that's another story). However, as the documentation is a bit sparse, I am not sure if it supports foreign-relationships and lazy-loading. Essentially, I have a class posting: public class Posting { [SubSonicPrimaryKey] public Guid InternalId { get; set; } public string Title { get; set; } public string Body { get; set; }

Subsonic 3 - SimpleRepository

∥☆過路亽.° 提交于 2019-12-17 19:06:44
问题 I am playing around with Subsonic 3's simple repository and am hitting walls in understanding how to deal with foreign keys... If I have a product object containing int ID; string name; string description; Category category; int categoryID (this one is just to persist the product's categoryID to the DB) and a category object containing int ID; string name; How can I use the repository to bring back a list of all products with their category object instantiated? At the moment I have written a

Adding DataAnnontations to Generated Partial Classes

蹲街弑〆低调 提交于 2019-12-17 18:24:41
问题 I have a Subsonic3 Active Record generated partial User class which I've extended on with some methods in a separate partial class. I would like to know if it is possible to add Data Annotations to the member properties on one partial class where it's declared on the other Subsonic Generated one I tried this. public partial class User { [DataType(DataType.EmailAddress, ErrorMessage = "Please enter an email address")] public string Email { get; set; } ... } That examples gives the "Member is

Parent and Child object in SimpleRepository

混江龙づ霸主 提交于 2019-12-14 03:43:52
问题 How would it work in Subsonic's SimpleReporitory if I wanted to be able to have a 1 to many relationship between objects? Would I have to create a bridge object and then build my parent object at runtime, or is this support built in? What I am looking for is the folowing: Adam's Example Shop... Public Class Shop Private m_id As Integer Private m_Name As String Private m_Employees As List(Of Employee) Public Property Id() As Integer Get Return m_id End Get Set(ByVal value As Integer) m_id =

SubSonic 3 Installation Doesn't Work?

匆匆过客 提交于 2019-12-13 18:40:26
问题 Ok I have following the tutorial here as best I can http://subsonicproject.com/docs/Setting_up_SubSonic_3.0 As the files you get in the download are nothing like what is shown in the video?? So I am literally just guessing which files to use?? Then I drag the files / folders into Visual studio (As the video shows) and NOTHING happens?? It just adds the files to my solution?? Or adds the folders to my solution as normal files... Nothing gets executed as shown in the video?? I realise Rob has

Subsonic 3.0 MVC and paragraph control

眉间皱痕 提交于 2019-12-13 06:33:18
问题 I have a subsonic 3.0 MVC site. Is it CMS based? if yes how can I use subsonic's paragraph control. If it's not CMS based then from where I can get it? The subsonic 3.0 on http://subsonicproject.com/ does not contains the CMS? 回答1: Subsonic 3 is merely used to provide Data Access and class mapping through t4 templates. There is no CMS. The worrying sentence in your question is " If its not CMS based then from where i can get it?". If its not cms based then you can't get it from anywhere. It

“Lambda Parameter not in scope” exception using SimpleRepository's Single method

走远了吗. 提交于 2019-12-13 03:45:06
问题 I'm attempting to use the SimpleRepository to perform a fetch based on a non-ID property. Here's the Customer class I'm using: [Serializable] public class Customer : IEntity<Guid> { public Guid ProviderUserKey { get; set; } public Guid ID { get; set; } } I'm using SimpleRepository with migrations turned on. The code that throws the "Lambda Parameter not in scope" is below: public class CustomerRepository : ICustomerRepository { private readonly IRepository _impl; public CustomerRepository

SubSonic3 VB.Net Add,Update, FirstOrDefault Problems

冷暖自知 提交于 2019-12-13 03:07:11
问题 I hade build sctive record dal with subsonic3 Vb.net templates. and i am dealing with alot of bugs in the sub sonic dlls. 1)in Add() function: (i have fix) when indx has counter in the db the returnd new key type is decimal the active record fil have an exception "Public member 'Change Type To' n type 'Decimal' not found". i managed to fix this bug. i changed in the activeRecord template the sub OlD Public Sub SetKeyValue(value As Object) Implements IActiveRecord.SetKeyValue If value IsNot

subsonic, mvc and activerecord

雨燕双飞 提交于 2019-12-13 02:56:21
问题 i am using subsonic 3.0 and active record with a mysql database now everything is fine, but i cant seem to create views see example: public ActionResult Index() { return View(contact.GetPaged(1,20)); } now normally i would right click and choose Add View i would then choose strongly typed and find the class for the repositary however for some reason the only classes i get showing up are for subsonic only but expect to see the new class from the new generated graniteMysqlDB if anyone could