subsonic

Weird strange things happening in repository record!

倖福魔咒の 提交于 2020-01-15 09:37:47
问题 SubSonic 2.2. I use the repository record pattern, with a table "appointment" with an appointmentId as auto-incrementing int. I am trying to update it, but when I do update the fields with something totally different, dirty columns are always zero, and I get an exception. System.NullReferenceException: Object reference not set to an instance of an object. at SubSonic.DataService.ExecuteQuery(QueryCommand cmd) at SubSonic.SubSonicRepository.Update[T](RepositoryRecord 1 item, String userName)

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: How to exclude a table column so that its not included in the generated SQL query

白昼怎懂夜的黑 提交于 2020-01-14 03:33:08
问题 I need to insert a record to a table. Subsonic builds the query something like this (as far as i know): INSERT INTO Table1 (Title, Description, RowVersion) VALUES (@Title, @Description, @RowVersion) But i want to remove the RowVersion column from the SQL query bacause its autogenerated by the sql server. How can i do that? 回答1: You don't need to worry about this. SubSonic is intelligent enough to handle this! Just create new object assign values to properties and save it. var o = new

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 Three (3) CreatedBy fields not updating

余生颓废 提交于 2020-01-03 00:53:33
问题 Using Subsonic 3 I have the fields: o CreatedOn (datetime) o CreatedBy (nvarchar(50)) o ModifiedOn (datetime) o ModifiedBy (nvarchar(50)) When I add data to my table it is not adding data to these columns. Am I missing something? 回答1: These fields aren't automatically populated in version 3 like they were in version 2, unless you are using the ActiveRecord templates. You could modify the templates pretty simply to add the functionality yourself. 来源: https://stackoverflow.com/questions/843062

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?

Is connection pooling working correctly in Subsonic?

和自甴很熟 提交于 2019-12-31 04:37:08
问题 I am getting reports that connection pooling is not working in the Subsonic orm when used with sql server on a remote machine. I'm not sure how they are monitoring this, maybe with the profiler. Subsonic opens late, closes early as you are supposed to do in an orm layer, but is there any problem with the implementation that would cause too many connections? 回答1: There is a way for a connection to remain open when using SubSonic. Many people assume that when you load a collection the reader

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); } }

CAS not working for VS2010 mapped drive

妖精的绣舞 提交于 2019-12-30 11:06:44
问题 I have a project using subsonic that I developed in Visual Studio 2008 on C: drive. No problem there. I've just upgraded to Visual Studio 2010 (and as my computer coincidentally died, I'm now running Windows XP virtualised with VirtualBox). The project runs without complaint on C: drive, but if I run it from G: (a mapped drive which points to a partition on the base PC), I can't run the custom tools subsonic uses (error listed below), OR run the web application ('start without debugging'