subsonic

SubSonic and Stored Procedures

限于喜欢 提交于 2019-12-04 17:11:50
When using SubSonic, do you return the data as a dataset or do you put that in a strongly typed custom collection or a generic object? I ran through the subsonic project and for the four stored procs I have in my DB, it gave me a Sps.cs with 4 methods which return a StoredProcedure object. If you used a MVC, do you usually use the StoredProcedure object or wrap that around your business logic and return a dataset, list, collection or something else? Are datasets still the norm or is that replaced by something else? If the results of the stored procedure has the same schema as one of your

Linq and SubSonic - returning nested complex types

烂漫一生 提交于 2019-12-04 15:32:38
I'm new to SubSonic and reasonably new to LINQ as well, so I'm just trying to put a little app together. I've got the templates all sorted and running okay, but I've run into a bit of trouble with this LINQ statement (simplified slightly, the real statement has some other joins but they don't affect this particular problem so I've removed them for brevity): var addresses = from address in Database.Addresses.All() select new Address() { MyNestedType = new NestedType() { Field1 = address.ADDR1 } }; If I execute this statement I get the error Invalid cast from 'System.String' to 'NestedType'.

SubSonic SimpleRepository Updates Cause Null Reference Exceptions

只愿长相守 提交于 2019-12-04 15:09:43
In researching the SubSonic's new SimpleRepository, I've found that calling the Update() method always throws a NullReferenceException . This is even true in the sample MVC download that's included with the 3.0.0.3 release. Does anyone know if there's a way to get updates to succeed? Here's an example. The if statement works; it adds the table and creates the record. Running this code a second time flow to the else block, and the update throws the exception. var repo = new SimpleRepository("c", SimpleRepositoryOptions.RunMigrations); var user = repo.Single<User>(u => u.Email == "a@b.com"); if

Using Subsonic for potentially heavily accessed ASPNET MVC Application

我只是一个虾纸丫 提交于 2019-12-04 14:12:52
I am about to start a project for a potentially heavily accessed ASPNET MVC application and I was thinking to use Subsonic for my DAL. I have some concern about the ability of Subsonic to handle thousands of concurrent requests. Can anyone give me some examples of popular web sites using Subsonic? Also if you have any suggestion regarding a possible substitute to Subsonic, besides NHibernate, that would be great as well. Thanks Thousands of concurrent requests? Are you sure that's likely? For what it's worth, DotNetKicks uses SubSonic, and never seems to have performance issues. I do about 4

How to intersept the save method on ActiveRecord on SubSonic ORM?

时光怂恿深爱的人放手 提交于 2019-12-04 11:02:05
I need to intercept the Save method, do some validations, alter some properties and then let it go again normally. How can I do this? Thanks! Alex I would recommend adding the following partial methods to be fired before their actual action: OnSave(CancelEventArgs e); OnAdd(CancelEventArgs e); OnUpdate(CancelEventArgs e); OnDelete(CancelEventArgs e); This isn't an event but I would use CancelEventArgs anyway, it's friendly, people know it and know how to use it and with it the actual action can be canceled from the partial methods. These two should be added too to the list of the existing ones

Subsonic 3 VS Entity Framework

被刻印的时光 ゝ 提交于 2019-12-04 09:34:43
问题 Anyone worked with Subsonic3 and Entity Framework here who can tell me the pros and cons? This is my first time attempting to try these. Subsonic is easy to setup so as the Entity Framework. I am not sure if Entity Framework works with other databases as SubSonic does like MySql PGsql etc...? I read this post (http://www.timacheson.com/Blog/2009/jun/entity_framework_vs_subsonic) which is convincing enough to chose Entity Framework over SubSonic. But I wanted a second opening. 回答1: Well, these

Subsonic 3 LINQ Projection issue, fixed or no?

我与影子孤独终老i 提交于 2019-12-04 07:29:33
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.CreateDate descending select new PulseListViewModel.Pulse() { AccountName = a.Name , Category = p.Category ,

Subsonic - How to use SQL Schema / Owner name as part of the namespace?

妖精的绣舞 提交于 2019-12-03 16:12:25
I've just started using Subsonic 2.2 and so far very impressed - think it'll save me some serious coding time. Before I dive into using it full time though there is something bugging me that I'd like to sort out. In my current database (a SQL2008 db) I have split the tables, views, sps etc. up into separate chunks by schema/owner name, so all the customer tables are in the customer. schema, products in the product. schema etc., so a to select from the customers address table i'd do a select * from customer.address Unfortunately, Subsonic ignores the schema/owner name and just gives me the base

What is so great about ORM?

被刻印的时光 ゝ 提交于 2019-12-03 13:47:44
So I'm having a head against the wall moment and hoping somebody can come help either remove the wall or stop my head from moving!! Over the last 3/4 weeks I've been investigating ORM's in readyness for a new project. The ORM must map to an existing, large and ageing SQL database. So I tried Subsonic. I really liked v2 and v3 after modding to work nicely with VB and named schemas in SQL was running OK. However, its lack of flexibility of having separate entity properties names vs column names had me pulling my hair out (sorry Rob). I tried Entity Framework but I found like others it lacking in

Using transactions with subsonic

耗尽温柔 提交于 2019-12-03 07:10:43
In my web application I've to keep audit of the user actions. So whenever user takes an action I update the object on which action is taken and keep audit trail of that action. Now If I first modify the object and then update audit trail but the audit trail fails then what? Obviously I need to roll-back changes to modified object. I can use Sql-Transactions in simple application, but I'm using Subsonic to talk to db. How I can handle the situation? Something like: Using ts As New System.Transactions.TransactionScope() Using sharedConnectionScope As New SubSonic.SharedDbConnectionScope() ' Do