c# - How to choose a data access method in ASP.NET MVC? -


I was programming in C # 2.0 WinForms for a while i wasp.net and new MVC frameworks and C # 3.5 I am starting to get involved in the new features. I have only read a little on LINQ from LINQ, but some test app has tried to do this in my WinForms app, I usually have some kind of data access layer, and all myself have been written SQL, of course, if anything is for me CRUD So, I am doing everything for this.

I looked at the tutorial on the www.asp.net/mvc website and both example framework and LINQ did the SQL example for example, they both look very similar. LINQ looks more like SQL, but the unit framework looks more like a C #.

My questions are:

  1. Is one method better than another?
  2. What are the advantages of one over the other?
  3. Can SQL be seen, which comes when using any of the methods?
  4. Since I am new to ASP, are web developers leaning on one side? LINQ-to-SQL Simple (but still well engineered)

  • Only LINQ-to-SQL works on SQL Server (unit framework is plug-in; Third party
  • Entity framework data (storage) model and object Supports more separation between models - LINQ-to-SQL is a literal table / column =>
  • LINQ-to-SQL is actually "full" in the stuff does :
    • UD FS does not support EF
    • EF sub-expressions (such as custom expression for trees) do not support like EF does not support some "clear" methods such as single ()
    • EF does not have some TSQL optimizations, which are called LINQ-to-SQL

Originally the EF moment is slightly more of a "v1" (or even "v0.9") product . However (and more importantly) - EF.NET 4.0 etc. is likely to be a suitable next version where as long as the LINQ-to-SQL view It's gonna change As the following major product Microsoft (rather than the two products to co-develop each other). You should think about long-term plans.

Right now, but EF is in the long run ... So I'm using a repository, etc. to hide some awesome implementation details - one bit leakage repository

3: With LINQ-to-SQL, assign TextReader to dataContext.log ; Console.Out works well - or I have one that writes to trace.asax. With EF.

4: I suspect that this complexity breaks a lot. People using SQL Server with a simple model, or are happy for a storage model that shines in the object model, currently use LINQ-to-SQL (which I see). People with more complexity and other databases use NHibernate; -P and then some EFs I am thinking that when EF is released in the next NIT 4.0 then how much will it change ...


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -