views:

119

answers:

3

I like the simplicity of the Simple Repository , this looks ideal for simple CRUD operations.

However, if I have a requirement for a complex query on top and ideally want my app to call a Stored Proc what is the recommended way to do this?

Does ActiveRecord cater for Stored Procs?

I will be using this in a ASP.NET MVC app and really looking for the easiest (to implement) solution that still offers me some flexibility/control in certain situations (e.g. use a proc when I want/need to).

I am aware of LINQ to SQL, Entity Framework and NHIbernate but would prefer Subsonic.

A: 

ActiveRecord is sweet for Rails

As I understand ActiveRecord for .NET is not out yet.

It should come out when Entity Framework 4 is out.

I would use Subsonic if I had to start project now, but if it's long term projct I would wait for ActiveRecord or would use CTP.

Daniil Harik
Subsonic has ActiveRecord, Simple Repository and ..er.. "standard Subsonic" (It might have a name..). I guess you could say Subsonic has multiple interface implementations. I am just not sure if I can mix and match them (and use them together).
Coolcoder
ActiveRecord is a principal not a product, don't get confused with the Rails' use of the phrase
Doug
+1  A: 

Yes ActiveRecord does support SPs, a method is generated for each one by the StoredProcedures.tt template. SimpleRepository doesn't have any support for SPs.

I'd recommend you go with ActiveRecord, you could theoretically mix and match it with SimpleRepository if you really wanted but I can't see it would do anything other than confuse your codebase.

Adam
A: 

You should go with ActiveRecord for now as it's the most forgiving. We use it on Tekpub and there's not reason it can't "scale" with you. Also, if you run into customization needs, you can change your templates, not our source (which was my design goal).

You can also use all the other SubSonic stuff - such as our simple query, batch query, and sugar library. They all play nice together so you're not locking yourself off.

Have a read on our docs site (subsonicproject.com/docs) and if you have a question you can mail us on our group (subsonicproject@googlegroups)

Rob Conery