Browse by Tags

Tagged Content List
  • Blog Post: Tip 46 – How to exclude a property using Code-Only

    This time a real simple one prompted by this question on StackOverflow. Problem: If you tell the Entity Framework about this class using Code-Only, by default every property becomes part of Entity, and as a result stored in the database. Usually this is what you want. But not always, imagine this class...
  • Blog Post: Interesting series of Posts exploring Code-Only

    Daniel Wertheim left a couple of comments on Tip 42 , that point to a series of posts he has written about using Code-Only to write clean code. The series is really interesting as he delves into topics like: facades, relationships between non-public properties, integrating pluralization, using structure...
  • Blog Post: Tip 42 – How to create a dynamic model using Code-Only

    Background: When we give examples of how to use Code-Only we always start with a strongly typed Context derived from ObjectContext . This class is used to bootstrap the model. For example this (property bodies omitted for simplicity sake): public class MyContext : ObjectContext { public ObjectSet<Category>...
  • Blog Post: Tip 38 – How to use CodeOnly with Astoria

    The normal way that you create an ADO.NET Data Services (aka Astoria) Service is by creating a class that derives from DataService<T>. public class BloggingService : DataService<BloggingEntities> And if you want to use Entity Framework under the hood the T you supply must derive from...
  • Blog Post: Code-Only best practices

    There have been lots of posts on the EFDesign blog talking about how the features in Code Only have evolved. But very little covering what we think will be the best way to write the code. You may have seen code like this: var prodConf = builder.Entity<Product>(); productConf.HasKey(p => p.Id...
  • Blog Post: Tip 32 – How to create a database from SSDL – EF 4 only

    We recently released a CTP that extends EF 4 Beta 1 which included Code Only. You can read more about Code Only here , here and here . If you look at the walkthroughs for Code Only you will see code that looks something like this: // Create a builder and configure it var builder = new ContextBuilder<MyContext>...
Page 1 of 1 (6 items)