Reputation: 1682
I want to call only stored procedures on database and fill my C# object according to the result. I just need a mapping file, and a fast reflection tool like Fasterflect found on CodePlex to create my own ORM.
Is there any ORM available with these feature for C# which has lightning fast performance ? or what should I do to complete the above scenario in terms of mapping database objects ??
Upvotes: 2
Views: 3039
Reputation: 1570
If you need fast read performance, use EF6.x and make sure you use AsNoTracking and also that you set up some additional values first. This will make it super-fast...but for the price that this supports just reading, so no change detection and no data-updates. This will make EF6x 5x faster than it's default behaviour, see this.
Also make sure you use database views, indexes to add extra speeds to all selects. But the best advice is: always check what code is sent to the database from the ORM layer, do eager-loading, use IQuery projections, ...
NHibernate is a fine tool too. I use it for my domain model where i handle all the changes.
Also here's another article of mine with the most common problems people have when using ORM inproperly (not using eager-load, etc.) - link. Also by profiling or eager load you can avoid N+1 select, by using views you can get additional speed...
Upvotes: 0
Reputation: 9298
There are several implementations of .NET ORMs.
The framework already has two, Linq to Sql and Entity Framework. What type of database are you trying to target?
If you are looking for open source implementations check out
I really wouldn't try building one yourself unless you have plenty of time! Most ORMs have a huge feature list.
I have used a product called LightSpeed from Mindscape. It support multiple rdbms, has a fantastic designer, superb linq capabilities and provides great performance.
Upvotes: 3