Q&A from LINQ to Entities Webcast

You got questions? Well we got answers! On today's webcast we had the special treat of having some of the members of the LINQ team online with us answering questions. There were so many of them I thought I'd post the conversation. I hope it helps answer any questions you've got, and if not then shoot me an email and we'll see what we can do! And thank you Elisa for all your help!

Asked: How are 'LINQ to Entities' and 'LINQ to Objects' related? (same technologies, or is there more)

Answered: Both LINQ to Entities and LINQ to Objects are implemenations of the LINQ technology. LINQ to Objects provides LINQ access to any IQueryable object. In this case LINQ to Entities is providing access to the data sufaced as objects through ADO.NET Entity Framework with the ability to access Microsoft SQL Server or any third party database, without needing to develop the layer that accesses the database and translates the LINQ Queries into a native SQL to the database.

Asked: Do you know where the EF update for VS 2008 Beta 2 is?

Answered: Yes, it can be downloaded at http://msdn.microsoft.com/data

Asked: is there a dependency on .NET 3.5?

Answered: yes

Asked: Is IntelliSense available for LINQ in Visual Studio 2008?

Answered: yes

Asked: Is LINQ available only to SQL Server ?

Answered: LINQ to SQL is available only to the SQL Server Family of databases. If you are looking for access to other databases (DB2, Informix, Oracle) LINQ to Entities and the Entity Framework provides this access.

Asked: will the model first scenario be imlemented for RTM?

Answered: Our Designer team is working hard on implementing this scenario prior to RTM.

Asked: will this work with oracle db?

Answered: Yes. We are working closely with both Oracle and Data Direct on providers for Oracle access

Asked: So this is only available with .NET 3.5 and vs 2008?

Answered: yes. The Entity Framework is currently available in Beta 2 on top of VS2008 from http://msdn.microsoft.com/data and will be released as an update to VS2008 in the first half of 2008.

Asked: How about class -> multiple tables and multiple classes -> table

Answered: Definately. LINQ to Entities and the Entity Framework provide a very flexible mapping scenario including these as well as Complex types and all three common types of Inheritance among others.

Asked: Can LINQ be used with VS 2005?

Answered: No

Asked: May I use LINQ to Entities and the Entity Framework with SQL Server too ? Or with SQL Server I should always use LINQ for DataSets ?

Answered: Yes you can. Mike is currently demo against SQL Server

Asked: How does LINQ work in an environment where you have a smart client talking to a server using .net remoting or web services?

Answered: This is actually a prime scenario for another project we are currently working on, Project Astoria, which makes it very easy to access the Entity Framework through a special Web Data Service. Stay tuned in November and December for more information on the Astoria project and check out http://astoria.mslivelabs.com

Asked: Is this compatible with SQL 2008?

Answered: Yes. There is one caveat however. In the currently available betas you cannot use Server Explorer in Visual Studio 2008 to access SQL Server 2008. We are working hard to enable this for upcoming releases of SQL 2008 and VS 2008.

Asked: What improvements can we expect in the designer? The current beta isn't particular useful for large databases/models.

Answered: The current designer is actually a CTP 1 that works with the Beta 2 of the EF. We are currently working hard to implement customer feedback and implement things such as the model first scenario. You should see significant changes in the designer coming soon.

Asked: Can the Entity Classes be Serialized and Deseralized like other .NET classes?

Answered: yes

Asked: We would like to be able to map a table to a complex object. For example, our tables have enteredDate and enteredBy columns. We have an AuditInformation class with both of these properties. We would like to have the Entity have a property of type AuditInformation and have LINQ to SQL/Entity map to the Object.AuditInformation property instead of separate properties.

Answered: From your explaination, it looks like Complex Types in the Entity Framework should be what you're looking for.

Asked: Are complex types available from LINQ to SQL?

Answered: No they are not.

Asked: I hope people would rather use LINQ than go back to text SQL queries ...

Answered: In most cases, I agree. There are however scenarios where you want to avoid the object materialization and identity tracking that is involved in LINQ, and rather access the Entity Data Model more directly to achieve performance. This is often where Entity SQL is used.

Asked: Are complex types the answer for inheritance as well? For example, I have a BusinessObjectBase class that has an id column (among other things). I would like my Customer object inherit from businessObjectBase and have the id populated. If this is the case, how do I map the CustomerId column to Entity.Id.

Answered: No. The Entity Framework supports the direct mapping of the three common inheritance types (TPH, TPConcrete Class and TPSubclass).

Asked: this deferred execution thingy is really confusing. Will LINQ2EF support explicit execution of the queries?

Answered: Yes

Asked: Do you think that your reviving the E-R concept will affect general OO practice? You have done a data-centric O-R here. Given the difficult history of O-R, MS included, do you expect a wider impact than just .NET development and SQL Server?

Answered: The Entity Framework Version 1 has been developed as a common model for many other technologies to build on. We have previously announced products such as Commerce Server building on the Entity Framework and you can imagine a world where Reporting Services etc also make use of the same model that your developers use...

Asked: So this technology basically replaces the need to write our own data layer?

Answered: that's one way to look at it :)

Asked: For enterprise applications, typically data access isn't done from the Presentation Tier. How would you approach using this with a Business Tier (e.g., through a service layer) or is Astoria THE way?

Answered: Astoria is best used when your presentation layer makes use of RIA (Silverlight) or Ajax etc. I have a couple of Samples coming out soon that explore the 3-teir scenario. Keep an eye on the ADO.NET team blog on http://blogs.msdn.com/adonet for the samples

Asked: Can this layer exist on a remote server with the Linq calls coming from a smart client?

Answered: yes

Asked: ah, "concrete class" uses two tables for each subclass...

Answered: sorry i didn't get to this sooner :)

Asked: where can i find 3 tier with linq examples and Software factory examples

Answered: Check out the sample on the Data Platform Developer Center site - http://msdn2.microsoft.com/en-us/data/aa937695.aspx