| |
browse.develop.com
Browse.develop.com is a community that was established to collect and
organize valuable web information. Our technical staff have selected and
indexed information and courses that they feel will help you stay
current on best practices across the SDLC.
|
17 Articles match "Entity Framework","Query"
| Related DevelopMentor Courses | MORE | | Entity Framework 5 + Enumerations => What’s not to love? Entity Framework 5 now supports enumerations (when using Visual Studio 2012 and targeting the.NET 4.5 framework). Next we’ll generate an entity data model from the database. We can now write some code to insert and query the database. Using enumerations with Entity Framework 5. The output looks like this: If you wish to query for just insects you need to write a bitwise AND statement, like: var query = from p in ctx.Planets where ( p.Habitable & HabitableEnum.Insects ) == HabitableEnum.Insects select p; That’s all folks, have fun! DevelopMentor Courses - Sunday, September 2, 2012 Generating an index in the database using Entity Framework Code First If you’re using Entity Framework Code First, then you may want to create an index on some of your table. var query = from c in model.Customers. select c; foreach ( var item in query ). {. Entity FrameworkThe way to do this is to call “Database.ExecuteSqlCommand” in the “Seed” method of your database initializer. class Program. {. static void Main( string [] args ). {. Database.SetInitializer ( new CodeFirstSampleDbInitializer() ); using ( var model = new CodeFirstSampleModel() ). {. where c.Name != Console.WriteLine( item.Name ); }. }. Required]. DevelopMentor Courses - Tuesday, January 17, 2012 |
25 Articles match "Entity Framework","Query"
| The Latest from DevelopMentor | MORE | | Optimistic concurrency in MongoDB using.NET and C# That may be fine for bank transfers, but it typically falls down in the face of disconnected models used by almost all ORMs such as Entity Framework. Frameworks such as Entity Framework have optimistic concurrency control built in (although it may be turned off). Basically there are three steps: Get an entity from the DB and disconnect. The only thing you need to do to use this library in your apps is to implement this interface on all top-level MongoDB entities and use a class derived from ConcurrentDataContext (in library below) for your data access. Michael C. Kennedy's Weblog - Monday, April 8, 2013 Entity Framework 5 + Enumerations => What’s not to love? Entity Framework 5 now supports enumerations (when using Visual Studio 2012 and targeting the.NET 4.5 framework). Next we’ll generate an entity data model from the database. We can now write some code to insert and query the database. Using enumerations with Entity Framework 5. The output looks like this: If you wish to query for just insects you need to write a bitwise AND statement, like: var query = from p in ctx.Planets where ( p.Habitable & HabitableEnum.Insects ) == HabitableEnum.Insects select p; That’s all folks, have fun! DevelopMentor Courses - Sunday, September 2, 2012 What’s new in ApprovalTests.Net v.20? png image, such as the one shown below: Entity Framework support People have long pondered how to test Entity Framework. However, if this method fails, then it will connect to referenced database and will execute the generated query and will return extra information about WHY the test failed. ASP routing support As community contributor, Krzysztof Ko?mic This can be particularly troublesome when changing an existing, unfamiliar piece of code. For example, it it easy to accidentally remove a button-click event. This bug has been fixed in this release. DevelopMentor Courses - Thursday, August 9, 2012 | -
| The Best from DevelopMentor | MORE | - Entity Framework 5 + Enumerations => What’s not to love?
Entity Framework 5 now supports enumerations (when using Visual Studio 2012 and targeting the.NET 4.5 framework). Next we’ll generate an entity data model from the database. We can now write some code to insert and query the database. Using enumerations with Entity Framework 5. The output looks like this: If you wish to query for just insects you need to write a bitwise AND statement, like: var query = from p in ctx.Planets where ( p.Habitable & HabitableEnum.Insects ) == HabitableEnum.Insects select p; That’s all folks, have fun! DevelopMentor Courses - Sunday, September 2, 2012 - Reporting using Entity Framework
Technologies like Entity Framework help us convert data in the database to.NET objects and add logic. Traditionally reports are run against the database and any self respecting reporting technology will to this day still offer you the option of building a report by querying directly against the database. 39: Next step is to create a WCF service application, add an Entity Framework model and drag the two views onto the model: Next we’ll implement two methods to use the Entity Framework model to select the data and return a list of CustomerView or OrderView objects. The Blomsma Code - Wednesday, October 20, 2010 - Type-Safe Include extension method for Entity Framework
If you’re interested in the Include method in a LINQ to Entities queries to be type-safe, then Joe Ferner has the answer for you in this post: Type-Safe Entity Framework Include: [link]. Entity Framework DevelopMentor Courses - Tuesday, January 24, 2012 - Generating an index in the database using Entity Framework Code First
If you’re using Entity Framework Code First, then you may want to create an index on some of your table. var query = from c in model.Customers. select c; foreach ( var item in query ). {. Entity FrameworkThe way to do this is to call “Database.ExecuteSqlCommand” in the “Seed” method of your database initializer. class Program. {. static void Main( string [] args ). {. Database.SetInitializer ( new CodeFirstSampleDbInitializer() ); using ( var model = new CodeFirstSampleModel() ). {. where c.Name != Console.WriteLine( item.Name ); }. }. Required]. DevelopMentor Courses - Tuesday, January 17, 2012 - Entity Framework 4 : ContextOption.LazyLoadingEnabled
Entity Framework 4 enables lazy loading of entities by default. So using Entity Framework your code may look something like this: 1: using ( MyEntities db = new MyEntities () ). 3: var query = from e in db.Employees. If however the Employee entity has a relationship things get a little interesting. Suppose the Employee has a relationship with a Department entity (via a property named ‘Department’). 3: db.ContextOptions.LazyLoadingEnabled = false ; 4: 5: var query = from e in db.Employees. 4: where e.EmployeeId == employeeId. The Blomsma Code - Tuesday, January 18, 2011 - Top Ten New Features in Entity Framework 4.0
The Entity Framework team at Microsoft has been extremely busy this past year to get a new version of the Entity Framework out the door. In response, the EF team published an Entity Framework Design Blog , soliciting feedback from the community on critical design decisions. Load related entities automatically on-demand. Different options for tracking changes to entities. Propagate entity changes across service boundaries for batch updates. The tools fix up entity names in case database tables are in plural form (Northwind!). Tony and Zuzana's World - Thursday, July 9, 2009 - Top Ten New Features in Entity Framework 4.0
The Entity Framework team at Microsoft has been extremely busy this past year to get a new version of the Entity Framework out the door. In response, the EF team published an Entity Framework Design Blog , soliciting feedback from the community on critical design decisions. Load related entities automatically on-demand. Different options for tracking changes to entities. Propagate entity changes across service boundaries for batch updates. The tools fix up entity names in case database tables are in plural form (Northwind!). Tony and Zuzana's World - Thursday, July 9, 2009 %>
| | |