asp.net mvc - DataContext.Entity vs DataContext.GetTable<Entity> -


I am implementing the repository "pattern" in my ASP.NET MVC application. That's why I was reading something to decide that I should expose the whole data syntax or constructor in the constructor or just through the table. GetTable & lt; T & gt; When performance is the most important factor.

While goggling me, I went to the following code. In this code, he takes the first table and then asks the question on that object. So now I am thinking that there is no benefit of this method or not. Public Nil Print Vision (//) creates a data reference that takes the path of the database datacountx DC = new datacontex (@ "C: \ Program Files \ Microsoft SQL Server \ MSSQL \" .1 \ MSSQL \ Data \ UCL.mdf "); // Retrieve a table of the winning table & lt; Winner & gt; Winner = DCTable & lt; Winner & gt; (); // Winners respectively, respectively, by the winner's order, the winners of the w winners respectively. // Printer prints the sequence of prize (result result) {Console.WriteLine ("{0} {1}, {2}", w.Year, w.Name, W. country); }}

The only way is that your repository is sufficient enough to be used for everyone Use of your application

  DataContext.GetTable & lt; Unit & gt;  

DataContext.EntityName is generated by standard T4 templates and has at least an extensible option.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -