Remondo

.NET developers brain repository in plain C#

Main menu

Skip to primary content
Skip to secondary content
  • Home
  • Tutorials
  • Code Snippets
  • Developer Podcasts
  • Presentations
  • Tools
  • Patterns and Principles

Tag Archives: entity framework

Post navigation

← Older posts

Using Entity Framework DbSet Local

Posted on May 14, 2012 by Leon van Bokhorst

A DbSet in an Entity Framework DbContext has a Local property that let us access entities already retrieved within the scope of the DbContext. This way it is possible to further query a local entity set, without sending a query to the database. More…

Posted in Tutorial | Tagged dbcontext, entity framework | 2 Replies

Entity Framework Add Remove Attach and Detach

Posted on May 11, 2012 by Leon van Bokhorst

The DbContext of Entity Framework lets us add, remove, attach and detach entities to and from it. Calling SaveChanges on the DbContext the Entity Framework performs different actions on entities dependant on their EntityState. So an added entity gets inserted, a removed entity gets deleted and so on. More…

Posted in Tutorial | Tagged code first, dbcontext, entity framework, objectcontext | Leave a reply

Entity Framework Concurrency Checking with Timestamp

Posted on May 10, 2012 by Leon van Bokhorst

Using a Timestamp column for optimistic concurrency control is quite a common practice in the SQL realm. While doing an insert, update or delete operation the database checks the Timestamp to see if the row has changed since the last time we retrieved it. More…

Posted in Tutorial | Tagged code first, concurrency, data annotations, entity framework | Leave a reply

Code First Fluent API Entity Type Configuration

Posted on May 9, 2012 by Leon van Bokhorst

Entity Framework let us use the Code First Fluent API in the DbContext to configure how your entities are created. This is done by using the modelbuilder in an override of the OnModelCreate method as explained here. More…

Posted in Tutorial | Tagged code first, entity framework, fluent api | Leave a reply

Entity Framework Code First Database Creation Strategies

Posted on May 7, 2012 by Leon van Bokhorst

Lets talk strategy for a moment. By default the entity framework uses a database creation strategy called CreateDatabaseIfNotExists. As the name implies this database initializer only creates the database if it’s not on your SQL Express or by a connectionstring specified location. More…

Posted in Tutorial | Tagged code first, database, entity framework, strategy | Leave a reply

Entity Framework Code First Data Annotations

Posted on May 6, 2012 by Leon van Bokhorst

In the previous post we explored the use of the Entity Framework Code First Fluent API to configure properties and specify how the corresponding database is created. You can do this also by using data annotations. More…

Posted in Tutorial | Tagged code first, data annotations, entity framework | Leave a reply

Code First Fluent API Entity Framework Model Creation

Posted on May 5, 2012 by Leon van Bokhorst

Since Entity Framework 4.1 we can use the Code First Fluent API to specify how our database gets created, effectively overriding the default settings. This is also possible with data annotations, but the Fluent API gives us a way to keep this out of our POCO classes and into the data layer. More…

Posted in Tutorial | Tagged code first, entity framework, fluent api | 4 Replies

Entity Framework Stored Procedures for Insert Update and Delete

Posted on May 1, 2012 by Leon van Bokhorst

Many Brownfield Architectures (read this book!) provide a database with stored procedures for CUD operations. Or maybe the company we work for has a scary DBA believing his precious little handcrafted stored procedures are a piece of art. More…

Posted in Tutorial | Tagged cud, entity framework, mapping, stored procedure | Leave a reply

Post navigation

← Older posts
Subscribe

ajax asp.net async bdd cache certificate code first concurrency csharp database entity framework exception handling factory gof http iis javascript jquery json linq mapping msmq mvc ood open source pattern reliability rest rss scrum security soap solid source control sql ssl tdd threading tracing unit testing visual studio was wcf windows xml

Archives

  • May 2012
  • April 2012
  • March 2012
  • February 2012
  • January 2012
  • December 2011

Comments

  • Leon van Bokhorst on The Strategy Pattern Example in C#Thanks
  • Hede on The Strategy Pattern Example in C#Nice hede article
  • Leon van Bokhorst on Simple Factory Pattern Example in C#Indeed; The Factory and Service Locator patterns perform functions found in Dependy Injection frameworks. They both adhere to the Dependency Inversion principle. That being...
  • Marco Vervoort on Simple Factory Pattern Example in C#Is dit niet de voorloper van Dependancy Injection? Met DI frameworks kun je dit ook uitvoeren, met meer configuratie mogelijkheden.
  • Leon van Bokhorst on Null Object Design Pattern Example in C#Thanks Alex
  • Alex on Null Object Design Pattern Example in C#Very well done. Hit and run example!
  • Leon van Bokhorst on Using Entity Framework DbSet LocalAha! Don't you just love it when that happens ;-)
  • Marco Vervoort on Using Entity Framework DbSet LocalWeer een 'ahaaa' moment... Leuke post.
  • Leon van Bokhorst on Hosting a WCF Service in IISGreat! :-D
  • Rafael on Hosting a WCF Service in IISI got it to work, thanks! My bad.
  • Rafael on Hosting a WCF Service in IISThanks again for the reply, so how did you publish to IIS? Using a WCF Web Service, like the post on this article?
  • Leon van Bokhorst on Hosting a WCF Service in IISI can't reproduce your problem. What I did was the following: - created a service library - connectionstring in the app.config - published the...
Leon van Bokhorst
(c) 2012 Remondo