![]() |
|
Entity Framework in Core Business Applications and Domain-Driven Design ApproachesSee the mini-DDD track in New Orleans & Madrid |
Vote for Entity Framework in Core Business Applications Automated Testing for
|
![]() |
|
Entity Framework in Core Business Applications and Domain-Driven Design ApproachesSee the mini-DDD track in New Orleans & Madrid |
Vote for Entity Framework in Core Business Applications Automated Testing for
|
Monday, August 15 2011 - Data Access
I’m excited about embarking on my first full-week workshop. Until now, I have done a number of one-day workshops but I have always felt that I needed more time. There’s so much to share! Maybe five days will be enough? The workshop will be in Boston (Waltham, to be exact) the first week of...
Read More...Tuesday, August 09 2011 - Book
After I finished writing the first edition of Programming Entity Framework, 832 pages long, I announced to anyone within earshot that if I every talked about writing another book to just shoot me. After I finished writing the second edition of Programming Entity Framework , which came in at nearly 900...
Read More...Tuesday, June 21 2011 - Data Access
I was using a hack to turn off the Database Initialization for code first. I didn’t want code first to do the model/database comparison, and found the best way I could figure out…I deleted the EDMMetadata table in the database. Yes, a total hack. Sergey Barskiy and Rowan Miller straightened...
Read More...Monday, April 18 2011 - Data Access
The Entity Framework 4.1 DbContext is a lightweight version of the EF ObjectContext. It's simpler to work with thanks t a streamlined surface of properties and methods. It may be just what you've always been looking for. But.... Once in a while you might want to use a random method of the ObjectContext...
Read More...Tuesday, April 12 2011 - Data Access
One of the announcements this morning at MIX11 was the MVC 3 Tools Update. Phil Haack has a blog post about them here: http://haacked.com/archive/2011/04/12/introducing-asp-net-mvc-3-tools-update.aspx I’m really happy to see that the newest MVC 3 Tools for Visual Studio embrace Entity Framework...
Read More...Friday, February 11 2011 - Data Access
Just got this very nice note from Alex Keh at Oracle. Hi Julie, Since I know you have a special interest in Entity Framework, I wanted to let you know that Oracle released its EF beta today. It can be downloaded from OTN. http://www.oracle.com/technetwork/topics/dotnet/whatsnew/index.html Regards, Alex...
Read More...Tuesday, December 07 2010 - Data Access
Oooh laa laa, my favorite so far. One of my most oft-repeated bits of EF guidance is that “a query’s job is to execute”. If you write a query such as var myquery=context.Customers.Where(c=>Id==24); Any time you do soomthing with myquery, such as call ToList or Count or bind it to...
Read More...Tuesday, December 07 2010 - Data Access
CTP5 provides validation for validator attributes in your classes. For example, I could apply this attribute to the Customer.CompanyName property: [MaxLength(20)] public string CompanyName { get; set; } How does it get there? If you are using Code First, you can just type it in your class. If you are...
Read More...Tuesday, December 07 2010 - Data Access
The Entity Framework 4 CTP5 was just released. There are lots of new features that affect the core use of Entity Framework as well as Code First. I’ll run through some of these features one blog post at a time. The first is the new T4 Template that gets installed, the ADO.NET DbContext Generator...
Read More...Sunday, July 18 2010 - Data Access
This is what I’ve realized about using the latest iteration of EF4’s Code First in the EF Feature Pack CTP. (I will keep clarifying that code first and the new EF bits in the CTP are a preview, not for production and subject to change …) When using code first where you simply create...
Read More...Friday, July 16 2010 - Data Access
There have been a lot of improvements to code first since CTP3 and in fact, the team has been experimenting with changes to the core Entity Framework APIs that not only support even simpler programming with code first but that we’ll benefit from in an upcoming release of .NET. (No, I don’t...
Read More...Thursday, June 03 2010 - Data Access
I receive a lot of random emails from developers with Entity Framework questions. (This is not a request for more! :)) If I’m too busy to even look or if it’s something I can’t answer off the top of my head, I swallow my pride and ask the person to try the MSDN forums. If the email...
Read More...Saturday, May 29 2010 - Book
We are closing in on finalizing the 2nd edition of Programming Entity Framework! Although the rough draft chapters are already available through Safari’s Rough Cuts program (here: http://oreilly.com/catalog/9780596807252 ) I have been editing and reshaping the content since those chapters were...
Read More...Sunday, May 16 2010 - Data Access
The date (Thursday, June 24th), the city (Stockholm) and the abstract are firm. REGISTER HERE: http://www.dotnet4ever.se/ or directly at http://www.informator.se/utbildningar/seminarier/seminarier/hard-core-entity-framework-40.aspx Now I have to wait for the person organizing this workshop on my behalf...
Read More...Wednesday, April 28 2010 - Book
Programming Entity Framework 2nd Edition (based on the RTM of VS2010/.NET 4.0) is currently available on Safari Rough Cuts at http://oreilly.com/catalog/9780596807252 . At this point most of the chapters are there. You’ll find 2-23. Note that chapter 4 will be broken into 4 and 5 in the final edition...
Read More...Sunday, April 11 2010 - Data Access
I’ve been using a lot of NoTracking queries to grab lists of data that I don’t need change tracked. It enhances performance and cuts down on resources. There are some nuances about these entities, however. One of the interesting behaviors of EF4’s Lazy Loading is that even if you have...
Read More...Sunday, April 11 2010 - Data Access
When I have done “what’s new in EF4” talks at user groups and conferences, I like to show off the new pluralization support in the EDM Wizard. I also like to have a little fun showing some cases where it doesn’t do so well. For example, it correctly singularized Breweries to Brewery...
Read More...Sunday, April 11 2010 - Data Access
Ayende has reminded us that Entity Framework Profiler’s Beta period ends tomorrow when it goes RTM. But that means the 30% discount also ends. It will go from $220US to $315US tomorrow. I spend a lot of time looking at what’s going on in my database when using EF and the views that EFProf...
Read More...Monday, April 05 2010 - Data Access
WCF RIA Services contains a special domain service for entity framework which will automatically be used if you use the Domain Service template in Visual Studio. This winter I tried the template with a few projects. One of them had EntityObjects and the other had POCO entities. The EntityObjects worked...
Read More...Wednesday, March 24 2010 - Data Access
The MIX build of RIA services has a bug that has been fixed since. But you might experience it as I did this morning and go around in circles for a while. This blog post is to help you avoid wasting that time. I normally create my model is in its own project and hadn’t seen this problem until this...
Read More...Monday, March 22 2010 - Data Access
Eager loading with Entity Framework depends on the special ObjectQuery.Include method. We’ve had that from Day 1 (first version of ef). Now we use ObjectSets in EF4 which inherit from ObjectQuery (thereby inheriting Include) and also implement IObjectSet. IObjectSet allows us to break the queries...
Read More...Saturday, March 20 2010 - Data Access
UPON REFLECTION, I DECIDED THAT THIS POST WAS PRETTY MISGUIDED (must have been one of those days...). So, for safety , I have removed it completely. You *can* use T4 to customize the code generated for EntityObjects but if you begin with the T4 EntityObject template and replace .NET 4.0 specific logic...
Read More...Thursday, March 11 2010 - Data Access
These are the first two. I’ve got more coming! If you don't have a Pluralsight subscription, grab a free guest pass and you'll have have access since these are part of the subset of guest pass content along with a ton of other great videos. These will also be on MSDN online shortly....
Read More...Thursday, February 18 2010 - Data Access
Hooray! Turns out it was a bug ("unintended breaking change) and it's getting fixed for RTM! :) [ see Connect submission and Microsoft's response ] Great catch George! This is an edge case that I had not noticed, but was brought to my attention this morning in an email from Dave Russell who pointed...
Read More...Wednesday, February 17 2010 - Data Access
Thanks to Danny Simmons ' comment below clarifying that the provides that support EF3.5 will still work for EF4 " just without new provider affecting features like model first." As far as I can tell, and confirmed by Fabio Pandolfo (@fabiopand on twitter) who is also on the hunt, DevArt's Oracle...
Read More...Tuesday, February 16 2010 - Data Access
When Entity Framework finally brought in support for Lazy Loading, there were still complaints. The lazy loading in EF4 is context based, not property based as defined by some of the other ORMs. (I’m not sure which ones or how many.) I was thinking about this today and realized that EF does, in...
Read More...Sunday, February 14 2010 - Data Access
In the first version of Entity Framework, if you wanted to create a PK/FK association between entities where there was no such constraint defined in the database you have to manually edit the SSDL (and lose that edit if you update the model from db). Why would you want to do this? The typical use case...
Read More...Sunday, February 14 2010 - Data Access
I had an email this morning from someone who was having trouble with reports populated using Entity Framework. He was running a report repeatedly but changing the filter. For example, Customers whose last name is Smith , then Customers whose last name is Barber . The problem was that after running the...
Read More...Saturday, February 13 2010 - Data Access
After thinking about the issue with EF4 still not supporting spatial data, I emailed spatial data wizard, Jason Follas , and asked him his thoughts. He’s not too familiar with EF but said if EF supported blob types then you could just use the Microsoft.SqlServer.SqlGeometry type to read in the...
Read More...Saturday, February 13 2010 - Data Access
Because I’ve had a lot of conversations about spatial data types lately, I thought I would create a SQL Server table that contained one of every type then bring it into an entity data model using the wizard to see what happens. This is in EF4. Here are screenshots of the table and the entity showing...
Read More...Friday, February 12 2010 - Data Access
If you have a graph of entities which are being managed by an ObjectContext, e.g, a LineItem and its Product, and for one reason or another, you detach the Product from the context, lazy loading will query for that Product again if you happen to call LineItem.Product. Now you will have two instances...
Read More...Thursday, February 11 2010 - Data Access
Adding a note to highlight Damien's comment below. Damien is on the EF team and does not recommend using the current Feature CTP with the RC. A new version will be available "soon". In comments of another blog post Ivan reminds me of something else I ran into the the VS2010 RC. I tweeted on...
Read More...Tuesday, February 09 2010 - Data Access
Update: After realizing that we still want access to it, the team has made the Beta 2 file available again. You can get it from their original blog post , not from the Visual Studio Gallery links but look for a zip file at the bottom of the post. But there's more! While I had managed to figure out one...
Read More...Tuesday, February 09 2010 - Data Access
The video from my webcast, Top 10 Treats in Entity Framework 4 is available on Oreilly’s website: http://www.oreillynet.com/pub/e/1517 . I just discovered that WebEx saved the chat window from my O’Reilly webcast last month. So I thought I would pick out the quesitons and answer them here...
Read More...Tuesday, January 26 2010 - Data Access
Tomorrow at 10am PST/1pm EST, I’ll be presenting a live web cast for O’Reilly Media called the Top 10 Treats in Entity Framework 4. The web cast is one hour (including intro and questions). Short & sweet. You can register at http://www.oreillynet.com/pub/e/1517 . The webcast will be recorded...
Read More...Tuesday, January 19 2010 - Data Access
One of the benefits of Visual Studio’s multi-targeting is that if you are still stuck using the .NET 3.5 version of Entity Framework and are unable to move to EF4 (so sad), you can still get the new designer goodies for a .NET 3.5 project. Remember that the designer is a VS2010 feature, not a ...
Read More...Thursday, December 10 2009 - Data Access
Just a friendly reminder that I’m passing on from one of the tech reviewers of my book who (thankfully) noticed that I had left a note in there about Single & SingleOrDefault not being supported. They were not in .NET 3.5 SP1 Entity Framework, but they are now supported in EF4. Single is the...
Read More...Tuesday, December 08 2009 - Data Access
Agile Entity Framework 4 Repository: Part 1- Model and POCO Classes Agile Entity Framework 4 Repository: Part 2- The Repository Agile EF4 Repository: Part 3 -Fine Tuning the Repository Agile EF4 Repository: Part 4: Compiled LINQ Queries Agile Entity Framework 4 Repository Part 5: IObjectSet and Include...
Read More...Saturday, December 05 2009 - Data Access
One of the things I struggled with in n-Tier apps in EFv1 was the options for reconstructing entity state on the server side in order to call SaveChanges when modified data was passed in from the client. The options were to hit the database to get a set of current server values and then apply updates...
Read More...Friday, December 04 2009 - Data Access
Not sure if I’ve blogged all of these (so twitter-addicted these days) so here’s a list of recent articles & webcasts I’ve done on EF4. CoDe Magazine What’s New in Entity Framework 4? Part 1: API Changes (Sept/Oct 2009) What’s New in Entity Framework 4, Part 2: Modeling...
Read More...Monday, November 30 2009 - Data Access
Agile Entity Framework 4 Repository: Part 1- Model and POCO Classes Agile Entity Framework 4 Repository: Part 2- The Repository Agile EF4 Repository: Part 3 -Fine Tuning the Repository Agile EF 4 Repositories Part 4: Compiled LINQ Queries Agile Entity Framework 4 Repository Part 5: IObjectSet and Include...
Read More...Tuesday, November 24 2009 - Data Access
Even when working with POCOs, the EF’s ObjectContext can track the objects using ObjectStateEntry objects just as it does for entities that inherit from EntityObject. I was thinking about ObjectContext.ObjectStateManager.GetObjectStateEntry. This method has two overloads. One takes an entity and...
Read More...Monday, November 23 2009 - Data Access
I have gathered up my slides and demos from Oredev and DevConnections and put them on the internet. The PPTs are on Slideshare. The demos are on the downloads page of my book’s website: www.learnentityframework.com . That page also has the links to the slideshare urls. Here’s what you’ll...
Read More...Sunday, November 22 2009 - Data Access
Third post in my Agile EF4 Repository blog series: Agile Entity Framework 4 Repository: Part 1- Model and POCO Classes Agile Entity Framework 4 Repository: Part 2- The Repository Agile EF4 Repository: Part 3 -Fine Tuning the Repository Agile EF 4 Repositories Part 4: Compiled LINQ Queries Agile Entity...
Read More...Friday, November 20 2009 - Data Access
(11/21/09: Note I have changed my interface name to IBAGAContext, because it is really a contract for the context, not the repository). The Series: so far Agile Entity Framework 4 Repository: Part 1- Model and POCO Classes Agile Entity Framework 4 Repository: Part 2- The Repository Agile EF4 Repository...
Read More...Thursday, November 19 2009 - Data Access
I’m going to lay out this out in a few blog posts because it’s complex. As I am not a TDD developer, I won’t be starting from the tests. I’m doing this in a fashion which is logical to me. But that will mean you’ll get some teasers along the way that will be fleshed out...
Read More...Wednesday, November 18 2009 - Data Access
Not at PDC? Well, yeah PDC is having some sessions streamed, like keynotes etc, but for the rest of us, there’s www.notatpdc.com . Two days of live presentations on lots of great topics. Here’s a screenshot of the schedule so far (note that it is CENTRAL time). Go to the website to get speaker...
Read More...Tuesday, November 17 2009 - Data Access
I knew that Intellitrace existed, but not until I saw Nikhil Kotahari’s tweet from PDC09 “ Cool VS demo - intellitrace - see your db queries, and track it back to your LINQ code #pdc09 ” did I think to look at what IntelliTrace reports with respect to Entity Framework database interaction...
Read More...Friday, November 13 2009 - Data Access
In my EF Tips & Tricks talk that I just did at DevConnections, I have a suggestion to reduce redundant methods where you might expose queries to generate reference lists. E.g. static List<CustomerType> CustomerTypeList(MyEntities context) { return context.CustomerTypes.OrderBy(ct => ct.Type...
Read More...Saturday, November 07 2009 - ASP.NET
Last year at the fall 2008 DevConnections conference, I was very happy to hear Scott Guthrie providing a clear message about web forms vs. MVC in ASP.NET 4.0. Now, I am seeing something that is new for MSDN Documentation, not only similar clarity but actual guidance on when Microsoft suggests to use...
Read More...Thursday, November 05 2009 - Data Access
The EF team just released the newest version of the Feature CTP that is now compatible with VS2010 Beta2. Hooray for compatibility, but more importantly, we can now work with a greatly enhanced version of the Code Only feature and Self-Tracking Entities. Code-Only is the API that allows you to use EF...
Read More...Thursday, October 29 2009 - Data Access
In EF v1, it is possible to have one way navigations where you have an association between two entities but a navigation in only one of them. But the designer didn’t support this. If you deleted a navigation, the association was automatically removed. You could, however, go into the XML and remove...
Read More...Friday, October 23 2009 - Data Access
I have created a screencast showing some of the best new features of the new Entity Data Model Designer. This is using the new Beta 2 version of Visual Studio 2010. The screencast is about 20 minutes long. This is not designed to be an introduction to building models. Rather, it specifically highlights...
Read More...Tuesday, October 20 2009 - Data Access
There are two changes to the lazy loading feature introduced in the Beta 1 version of Entity Framework. The first is that the property, ObjectContext.ContextOptions.DeferredLoadingEnabled has been changed to ObjectContext.ContextOptions.LazyLoadingEnabled . This is a breaking change from Beta 1 and you’ll...
Read More...Tuesday, October 20 2009 - Data Access
In EF version 1, a reference entity and it’s related EntityReference.EntityKey stay in sync when you change one or the other. E.g., if you have a sales order, it’s Customer property and the CustomerReference.EntityKey are automatically kept in sync by the ObjectContext. (Thanks to Craig for...
Read More...Monday, October 19 2009 - Data Access
Visual Studio 2010/.NET 4 released today on MSDN for subscribers so we can now start playing. It is too soon for screenshots but here are some awesome things to look for in Beta 2 after poking around for a bit. 1) Foreign Keys are now the default for new models. You’ll see the foreign key checkbox...
Read More...Tuesday, September 29 2009 - Data Access
Last summer, I asked this question in a thread in the MSDN forums : So is there anyway to completely override savechanges - just replace it with your own code if for some reason you wanted to? The answer was no. As I am digging deeper and deeper into EF4 while I write the 2nd edition of Programming Entity...
Read More...Thursday, September 03 2009 - Presentations
Update: The webcast is online! But I unfortunately, the sound is dreadful. I’m still waiting for the recording of the webcast to go online. It’s not there yet, but when it is, it will be on the same OReillyNet page that was used for registering: Entity Framework Tips & Tricks August 27th...
Read More...Wednesday, August 26 2009 - Data Access
Tomorrow (Thursday Aug 27th at 1pm EST) I will be presenting a one hour webcast on Entity Framework Tips and Tricks . If you are curious what to expect, here’s the rundown. It’s a Tips & Tricks session, filled with a variety of things that people ask about on the forums and other things...
Read More...Tuesday, August 25 2009 - Data Access
I’ll be doing a webcast on Entity Framework Tips & Tricks this Thursday for O’Reilly Media. It will be at 1pm EST and last for an hour. I plan to set aside some of that time for Q&A. It’s always fun to share these tips and I hope you can join me. More details and register here...
Read More...Thursday, August 20 2009 - Book
I have a very difficult task ahead of me with the EF4 version of my book. The book is already over 800 pages and will only get longer with all of the new features in Entity Framework 4. However O’Reilly has tasked me to keep the book to 800 pages. Something has to give. I am very proud of the fact...
Read More...Tuesday, August 11 2009 - Data Access
There’s an Entity Framework mapping that I have paid very little attention to because I didn’t realize it was possible. It was possible, just not obvious or easy in VS2008 SP1. Thanks to Adam Cogan , who asked a question about this feature, I’ve discovered that it gets a lot more usable...
Read More...Monday, August 10 2009 - Book
Well, it’s official. I’ve gone completely mad and just sent a signed contract back to O’Reilly for the rewrite of my book, Programming Entity Framework. With such big changes to Entity Framework, I could not let the current version of the book fade away, even though so much of it will...
Read More...Monday, August 10 2009 - Data Access
If you are working with the Beta 1 of VS2010 in an Entity Data Model, you might notice some new properties in the Properties Window for an entity’s scalar property. Are they new properties? Actually only one of them is. Let’s first change the view to see how these properties are grouped....
Read More...Saturday, August 08 2009 - Data Access
Kati Iceva, the gal I know as the brains behind query compilation for Entity Framework (though she may have some partners in crime) has written a great blog post laying out some of the improvements to query generation in EF4. Improvements to the Generated SQL in .NET 4.0 Beta1 Kati explains 7 major changes...
Read More...Saturday, August 01 2009 - Data Access
When you are building or updating a model from a database, included Stored Procedures find their way into the SSDL (Store Schema Description Layer) of the metadata but not into the conceptual model. In order to expose them in your model, you need to create something called a Function Import which imports...
Read More...Wednesday, July 22 2009 - Data Access
I made a big effort not to allow my What’s New in VS2010 presentation at Vermont.NET to turn into a What’s New in EF4 session. However, while I was demoing the Extension Manager, I used the T4 Editor extension as an example and what better way to show off T4 then to show the new code generation...
Read More...Wednesday, July 22 2009 - Data Access
I certainly have not yet explored the depths of EF4 to the same extent as I have with the current version and I have a lot of discoveries ahead of me. Thanks to a tweet this morning by Zekq , I finally saw one of the promised improvements to EF’s stored procedure support. In EF v1, you can easily...
Read More...Monday, June 22 2009 - Data Access
There were three big things that the EF team could not get into the VS2010 box on time – POCO T4 Templates, Code-Only features (POCO without a model) and Self-Tracking Entities. Even though VS2010 is only in Beta 1, the way the release cycles work, these three things won’t be part of the...
Read More...Sunday, June 21 2009 - Data Access
Model Defined Functions are a great addition to EF4. It allows you to add functions directly into your model rather than having to place the additional logic into business classes. This not only allows the functions to be “just there”, but you can use them in queries, something that you cannot...
Read More...Thursday, May 28 2009 - Data Access
Previous "What's New in EF 4 Posts" A Look at Lazy Loading in EF4 May 22 Upgrading EF projects to EF4- Don't forget to target .NET 4.0 May 22 Customizing EDM Code Gen in EF4 May 21 Complex Types in the EDM Designer in EF4 and a look at updating complex types in code May 21 The much improved...
Read More...Tuesday, May 26 2009 - Data Access
The Swiss MSDN team released an awesome Hands on Lab (thanks Danny for the pointer). One of the features of the lab was an n-tier solution. I had to see how they did it. They are using a shallow graph - i.e. no graph at all, so only have to deal with single entities. Then what they are doing is passing...
Read More...Friday, May 22 2009 - Data Access
Previous "What's New in EF 4 Posts" Upgrading EF projects to EF4- Don't forget to target .NET 4.0 May 22 Customizing EDM Code Gen in EF4 May 21 Complex Types in the EDM Designer in EF4 and a look at updating complex types in code May 21 The much improved EDM Wizard Pluralization in VS2010 May...
Read More...Friday, May 22 2009 - Data Access
Previous "What's New in EF 4 Posts" Customizing EDM Code Gen in EF4 May 21 Complex Types in the EDM Designer in EF4 and a look at updating complex types in code May 21 The much improved EDM Wizard Pluralization in VS2010 May 21 Checking for EF to TSQL Query Compilation Changes in VS2010 Beta1...
Read More...Thursday, May 21 2009 - Data Access
Previous "What's New in EF 4 Posts" Complex Types in the EDM Designer in EF4 and a look at updating complex types in code May 21 The much improved EDM Wizard Pluralization in VS2010 May 21 Checking for EF to TSQL Query Compilation Changes in VS2010 Beta1 May 19 EF4- What is and is not supported...
Read More...Thursday, May 21 2009 - Data Access
Previous "What's New in EF 4 Posts" The much improved EDM Wizard Pluralization in VS2010 May 21 Checking for EF to TSQL Query Compilation Changes in VS2010 Beta1 May 19 EF4- What is and is not supported May 13 One of the great features of an EF Entity Data Model is the complex type. However, the designer...
Read More...Thursday, May 21 2009 - Data Access
Previous "What's New in EF 4 Posts" Checking for EF to TSQL Query Compilation Changes in VS2010 Beta1 May 19 EF4- What is and is not supported May 13 As promised, there have been a LOT of improvements to the EDM Designer in VS2010. THe first one I looked for was to see how the pluralization worked (using...
Read More...Tuesday, May 19 2009 - Data Access
Previous "What's New in EF 4 Posts" EF4- What is and is not supported May 13 I know that the very brainy Kati Iceava is working on improving the query compilation that SqlClient does when creating TSQL from EF queries, so I checked a few queries to see if the changes had reached the Beta yet. I looked...
Read More...Monday, May 18 2009 - Data Access
As a follow up to a post I wrote earlier today on unit testing in the current version of Entity Framework [ Unit Testing in EF v1 - the database conundrum ], I wanted to point to a new post that appeared this afternoon on the ADONET team blog by Diego Vega on testing in EF4 (the new version that will...
Read More...
![]() |