Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a good lightweight ORM for our needs?

Ok I know "what X should I use" is very broad so let me narrow down our usage scenario. Basically, we should have been using an ORM a long time ago. Now though there is no way we can go through and rewrite every line of generated SQL Queries in our C# code. But we want to at least take a few steps in the right direction. So when we write new code(and in free time with refactoring) we want to convert over to some sort of ORM.

What would be a good ORM for this purpose? We are using .Net 3.5 and ASP.Net(webforms). There is nothing insanely complex about our database except for a few tables have a "dynamic" schema. We have a numerous amount of views(not used by the web application much though) and we have/use very few stored procedures. Our database is SQL Server 2005. Our price range is as cheap as possible and open source is preferred. This is a proprietary project however so we can't use a GPL library and such.

About the dynamic schema: Basically in some instances a column(of varying types) can be added or removed to certain tables.

And our view usage is almost non-existent and we could always take out the stored procedure code.. I believe there is only 2 or 3 in the database.

like image 922
Earlz Avatar asked Dec 06 '22 02:12

Earlz


1 Answers

Massive - https://github.com/robconery/massive

or

PetaPoco - https://github.com/toptensoftware/petapoco

Both are single .cs files with no dependencies except what's in the GAC.

(full disclosure, PetaPoco is something I wrote)

like image 155
Brad Robinson Avatar answered Dec 09 '22 16:12

Brad Robinson