Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

Which approach is better regarding using EF with stored procedure or directly using tables.

$
0
0

Hi All,

I am using EF 6.

I am using LINQ to Entities for database operations.

If I need to fetch the data from database (with making  joins in tables or without join) I can do something like below.

DBEntities db = new DBEntities();
var data = db.myTable.Where(m => m.status == true)
.Select(n=> new { n.col1, n.col2}).ToList();

The same work I can do by first making stored procedure then use that stored procedure in EF.

Which one is better? Is there  any performance difference?

Please suggest.

Thanks


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>