Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessing stored procedures with robconery / massive?

Another great article by Rob on the Massive ORM. What I haven't been able to find is references on how to access stored procedures. SubSonic had some issues with the overhead of using ActiveRecords, so I preferred to do data access with stored procedures, still using the SubSonic ORM.

What I haven't yet seen is outright support for things like SQL Server's TVP's in an ORM, so I modified SubSonic (shameless plug) to support them.

Is it possible to access SQL Server sprocs with Massive. Secondly, is there TVP support?

like image 994
ElHaix Avatar asked Mar 16 '12 14:03

ElHaix


1 Answers

Stored procedures are not specially supported, but because you can execute basically any SQL with Massive they will just work:

Sample from the Massive Update 2 article:

var orders = tbl.Query("CustOrdersOrders @0", "ALFKI");
foreach (var item in orders) {
    Console.WriteLine(item.OrderID);
}

And if your main focus is on stored procedures there is even a Micro ORM comparison article about it: MicroORMs for .NET: Stored Procedures

like image 194
nemesv Avatar answered Sep 26 '22 00:09

nemesv