Posts Tagged ‘entity-framework’

From the picture Julie painted it sounds like the Entity Framework is finally coming together. While I’m sure it’s far from perfect the latest version would seem to have addressed MANY of the issues I ran into the first time I used it. With EF being such a strong contender, it would seem my decision has come down to nHibernate and EF. Microsoft safety versus the guys that have been doing it right for a lot longer… tough call!

Julie Lerman on Entity Framework 4.0Julie is back to talk about the improvements to the Entity Framework in version 4.0.

via .NET Rocks!.

Read Full Post »

As I looked into the ITypedList interface I realized that perhaps everything I needed was already implemented as my business objects are generated by Linq-To-Sql? The answer turns out to be “sort-of”.

I’m taking a peek at both the Entity Framework and LINQ to SQL, and while I like the systems (and of course the LINQ integration) I’m a little skeptical on the data-binding aspect. I’ve taken query results and inspected them, and they don’t appear to implement the standard .NET list-binding interfaces (IBindingList, and more importantly ITypedList), leading me to believe that binding them to a grid (or anything else) is going to use reflection to get/set my entity properties. This seems like a comparatively expensive operation, especially when all of the code is generated anyway and could implement the interfaces.

via Does Entity Framework/LINQ to SQL Data Binding use reflection? – Stack Overflow.

Read Full Post »

Scenario: Important meeting! Too much coffee! Bad lighting! In walks the killer! Wait…

No, that’s wrong. In walks Visual Studio 2010 Beta 2 with an inability to open an EDMX created with Visual Studio 2010 Beta 1, asking if I’d like to open the file in an XML editor. Ack! A previously printed paper diagram (for the meeting) and a bit of time later I resolved the differences between my EDMX and a test EDMX created with Beta 2.

  1. The Schema tag,next item after <edmx:StorageModels>, had the correct xmlns property but was missing entirely the xmlns:store property. Adding xmlns:store=”http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator&#8221; was required.
  2. The Schema tag,next item after <edmx:ConceptualModels>, had the correct xmlns property but was missing entirely the xmlns:annotation property. Adding xmlns:annotation=”http://schemas.microsoft.com/ado/2009/02/edm/annotation&#8221; was required.
  3. Changing all “store:” prefixed properties of elements within  ConceptualModels to be “annotation:” prefixed.
  4. Swore at Microsoft a little for giving me the “prividledge” of hand-editing a 2400 line xml file.

A save and compile later I could open my diagram and proceed. Hope that helps!

Read Full Post »

When my ADO.NET Data Services web service started throwing SqlCommand timeout messages I hit up Google and finally found a post in German(?) that pointed me in the right direction. The problem seems to be the Entity Framework Connection CommandTimeout, which can be easily modified overloading the OnStartProcessingRequest event.

When working with the ADO.NET Data Services (aka Astoria) we eventually get to the point that the tasks become more complicated and increases the load on the server. In solchen Situationen ist man mit potentiellen Timeouts in allen Ebenen konfrontiert. In such situations one is confronted with potential time-outs at all levels. In diesem Post zeige ich welche Timeouts es gibt, aber speziell will ich zeigen wie ich das Timeout des Entity Frameworks (SQL) in Kombination mit der MS REST Schicht ADO.NET Data Services anpassen kann. In this post I will show that there is a timeout, but specifically I want to show how the timeout of the Entity Framework (SQL) in combination with the MS REST can adjust layer ADO.NET Data Services.

ADO.NET Data Services, Entity Framework, and SQL / HTTP Timeouts

Read Full Post »

This looks very useful for anyone (poor wretch) wrestling with the Entity Framework.

EdmGen2 is a command-line tool for the Microsoft ADO.NET Entity Framework. The tool can be used as a replacement for the EdmGen.exe tool that ships with the .Net framework 3.5 SP1. EdmGen.exe can only read and write the CSDL, SSDL & MSL file formats. However, EdmGen2.exe can read and write the EDMX file format used by the Visual Studio design tools. Additionally, EdmGen2.exe can translate between EDMX and CSDL, SSDL & MSL formats, and the source code can act as examples on using the tooling APIs defined in the System.Data.Entity.Design assembly.

via EdmGen2.exe – Home.

Read Full Post »

After inquiring on the official forums about new features in Entity Framework 4.0 around join tables this is what I heard back. In short, no new news. 😦 Which is too bad. Our model doesn’t really model entities until we have some way of hiding the join tables or otherwise demoting them to second-class status.

Your understanding is correct, and, no, there aren’t any substantial additional workarounds in EF4. One of the fundamental problems when you have additional properties on your join tables is that you still need some mechanism to access those properties. So if they were truly hidden, that would cause other difficulties. Our current thinking is that in some future release we’ll not hide them per se, but we will provide mechanisms to make it easier to have a collection or reference that represents a “double-hop” from one entity to the join-table-entity and then on to the entity or entities on the other side. You can simulate some of this yourself now by creating a property on your entity which is of type IEnumerable or something like that where the getter does the double hop, but of course that doesn’t help you when it comes time to do a linq query across both hops or that kind of thing.

– Danny

via Join Table Hiding Improvements in EF4? Workarounds?.

Read Full Post »

Need to debug an ADO.NET Data Service?

Another interesting point has to do with error handling. The option for error handling is set during InitializeService. If an exception is thrown while InitializeService is being called, we don’t trust whatever was set on the configuration, and instead of the ADO.NET Data Service error handling kicking in, we’ll let the exception bubble out. Typically the service will be running as a WCF service, which means you’ll get the error page with the blue band on top (when viewed in a browser). To get detailed errors in this case, you can do something like this.

[System.ServiceModel.ServiceBehavior(IncludeExceptionDetailInFaults = true)]

public class YourService : DataService

{ … }

via Marcelo’s WebLog : So Special – InitializeService in ADO.NET Data Services.

Read Full Post »

Older Posts »