sql-server-2008stored-proceduressubsonic2.2massivetable-valued-parameters

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?


Solution

  • 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