Accessing stored procedures with robconery / massive?

一世执手 提交于 2019-12-07 02:20:12

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/9739441/accessing-stored-procedures-with-robconery-massive

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!