subsonic3

SubSonic 3 and multiple PK columns

冷暖自知 提交于 2020-01-20 08:50:07
问题 I'm having problem with SubSonic 3 and multiple Primary Key columns. It seems like it isn't supported via the ActiveRecord T4 script. In line 173 of Settings.ttinclude return this.Columns.SingleOrDefault(x=>x.IsPK) ?? this.Columns[0]; It tries to get a Single Primary Key Column and failed. Any solutions? 回答1: Many ORM products do not support composite keys due to the overwhelming complexity of doing so. As far as I know, NHibernate is the only well-known .Net ORM product that does. Mindscape

subsonic 3.0 , The SqlServer default value doesn't work?

*爱你&永不变心* 提交于 2020-01-14 03:46:07
问题 I used subsonic 3 with T4,It's very simple to use.But I get a problem now.I specify the default value in the sqlserver 2005.Then I called save() method in subsonic.I found the default value doesn't work. 回答1: Default values won't work on inserts because your object will set the value first - whether it's null or ... whatever. The answer here is to set the default on the object. 来源: https://stackoverflow.com/questions/1171025/subsonic-3-0-the-sqlserver-default-value-doesnt-work

Subsonic 3 LINQ Projection issue, fixed or no?

懵懂的女人 提交于 2020-01-13 02:42:47
问题 I'm currently experiencing the issue mentioned here (and several other places): Subsonic 3 Linq Projection Issue This is occurring using the 3.0.0.4 release package, and it also occurs when I grab the latest from GitHub and build it. I am using the LINQ Templates. I have this code: var newModel = new ViewModels.HomeIndexViewModel() { PulseListViewModel = new ViewModels.PulseListViewModel { Pulses = from p in _pulseQuery join a in _accountQuery on p.AccountId equals a.AccountId orderby p

Subsonic 3.0 Left Join

十年热恋 提交于 2020-01-02 19:15:08
问题 Trying to do a left join in subsonic using linq but it doesn't seem to work, I get a big error. I'm pretty sure the query is correct as I've done it a few times with objects and Linq2Sql. var post = from p in Post.All() join q in Quote.All() on p.ID equals q.PostID into pq where p.ID == id.Value from qt in pq.DefaultIfEmpty() select new {p, qt}; It just seems subsonic isn't able to generate the required SQL from left join linq queries. Am I doing something wrong here? Is there a work around?

Subsonic 3.0 Left Join

泄露秘密 提交于 2020-01-02 19:14:59
问题 Trying to do a left join in subsonic using linq but it doesn't seem to work, I get a big error. I'm pretty sure the query is correct as I've done it a few times with objects and Linq2Sql. var post = from p in Post.All() join q in Quote.All() on p.ID equals q.PostID into pq where p.ID == id.Value from qt in pq.DefaultIfEmpty() select new {p, qt}; It just seems subsonic isn't able to generate the required SQL from left join linq queries. Am I doing something wrong here? Is there a work around?

Subsonic 3 + LINQ bug

♀尐吖头ヾ 提交于 2019-12-31 04:09:25
问题 A weird bug with Subsonic 3.0.0.3 Using - as an example - AdventureWorksLT DB When I run this code I get null for gname (although name gets the value ok) And w is 0 instead of the value in the 1st row [If I change select new MyData to just select MyData - it works OK] class Program { static void Main(string[] args) { var q = from g in Product.All() select new MyData{ gname = g.Name, name = g.Name, w = g.Weight.Value }; var list00 = q.Take(1).ToList(); Console.WriteLine(list00[0].gname); } }

SQLite and sub-sonic

谁说胖子不能爱 提交于 2019-12-24 23:14:33
问题 Does Subsonic supports SQLite, if so can subsonic work with Win7 Phone ? 回答1: SubSonic Supports sqlite out of the box - windows phone 7 was never tested nor tried as far as I know - would be an interesting experiment! 来源: https://stackoverflow.com/questions/3652066/sqlite-and-sub-sonic

Subsonic 3/ASP.net MVC issue trying to override class column properties

那年仲夏 提交于 2019-12-24 20:26:31
问题 I am using Subsonic 3 (T4 template) to generate the models for my mvc app. However the default template does not allow for nullable columns, so when I go to save the record it errors out if a nullable datetime column is blank. (See this post...) Question: What is the best practice to handle this? Option 1: Change the template to check if it is a nullable column and decorate the datatype with ? That would take me out of sync with any changes Rob makes to his templates which I might want Option

Adding Column Using Subsonic 3.0.0.5 Migration

本秂侑毒 提交于 2019-12-24 19:54:18
问题 I want to know that How to Insert New Columns to an existing database Table using Subsonic 3.0.0.5 MIGRATIONS. Basically I want to alter an existing table in MS SqlServer database and add three more columns into it. Please tell me How I will be able to do it Regards, Naveed Khan 回答1: Just change your object and the column will be added/updated whatever. So if you have an object called "Post" and add a property, it will be added as a column in the DB. See this video... http://subsonicproject

Subsonic 3/ASP.net mvc trying to save a null value in a datetime column

情到浓时终转凉″ 提交于 2019-12-24 18:58:13
问题 I have a table that holds system users with their last login date and time in it. The admin users of the system need to be able to add users, but when I add the new user record a validation error occurs unless I put a valid datetime in the last login date field. I've tried manually changing the field to dbnull, null, etc prior to the save but it says those values cannot be converted to datetime. The column does allow nulls in the db. Any suggestions? 回答1: If you set LastLogin to be DateTime?