| |
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.
|
22 Articles match "Database","Entity Framework"
| 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. Nothing exciting, since our database has just one table. Instead of a short we want to map the field to the following enumeration (note that having the enumeration be of type ‘short’ is significant, the type you select for your enum needs to match the column type in the database): public enum HabitableEnum : short { Humanoids = 1, Insects = 2, Droids = 3, None = 4, All = 5 }. 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. The way to do this is to call “Database.ExecuteSqlCommand” in the “Seed” method of your database initializer. Entity FrameworkThe sample below shows how it is done (thanks to Rolf for pointing me in the right direction): using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data.Entity; using System.ComponentModel.DataAnnotations; namespace CodeFirstPlayground. {. class Program. {. where c.Name != Required]. DevelopMentor Courses - Tuesday, January 17, 2012 |
44 Articles match "Database","Entity Framework"
| The Latest from DevelopMentor | MORE | | Optimistic concurrency in MongoDB using.NET and C# 'This article demonstrates a technique and supporting library for adding optimistic concurrency control to NoSQL databases and MongoDB in particular. Ideally, all databases that allow concurrent access or disconnected access need to implement some form of concurrency control. 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. Moreover, it is entirely inappropriate for NoSQL databases. Basically there are three steps: Get an entity from the DB and disconnect. 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. Nothing exciting, since our database has just one table. Instead of a short we want to map the field to the following enumeration (note that having the enumeration be of type ‘short’ is significant, the type you select for your enum needs to match the column type in the database): public enum HabitableEnum : short { Humanoids = 1, Insects = 2, Droids = 3, None = 4, All = 5 }. DevelopMentor Courses - Sunday, September 2, 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. Nothing exciting, since our database has just one table. Instead of a short we want to map the field to the following enumeration (note that having the enumeration be of type ‘short’ is significant, the type you select for your enum needs to match the column type in the database): public enum HabitableEnum : short { Humanoids = 1, Insects = 2, Droids = 3, None = 4, All = 5 }. DevelopMentor Courses - Sunday, September 2, 2012 - Reporting using Entity Framework
For many years the mantra for implementing business logic in your line of business application has been: “don’t put it in the database, don’t put it in the user interface”. 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. Life is good. Then it is time to create a report. Let’s look at a sample. 2: GO. The Blomsma Code - Wednesday, October 20, 2010 - 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. The way to do this is to call “Database.ExecuteSqlCommand” in the “Seed” method of your database initializer. Entity FrameworkThe sample below shows how it is done (thanks to Rolf for pointing me in the right direction): using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data.Entity; using System.ComponentModel.DataAnnotations; namespace CodeFirstPlayground. {. class Program. {. where c.Name != Required]. DevelopMentor Courses - Tuesday, January 17, 2012 - Entity Framework - Model First: One-to-One relationship
If you’re doing Model First with Entity Framework you may run into a scenario where you want to design a 1-to-1 relationship, but also have a foreign key be available on your entity. The default behavior in Entity Framework when doing a 1-to-1 relationship (with Model First), or 1-to-0.1 Add the entity that goes on the 1 side of the association, give it a primary key of type integer. Add the entity that goes on the 0.1 Click on the 1 entity and add an association, make it a 1-to-0.1, Now you’re ready to generate your database schema. DevelopMentor Courses - Wednesday, June 29, 2011 - Tony Sneed: Build Async Services with ASP.NET Web API and Entity Framework 6
If you are building web services that interact with a database, chances are they are not written in a scalable fashion. Web services based either on WCF, which supports both SOAP and REST, or on ASP.NET Web API, which exclusively … Continue reading → DevelopMentor Courses - Friday, March 22, 2013 - Entity Framework 4.1 power tools
Power Tools making it even easier to do Code First development with an existing database. Guess it isn’t really code first in that case but database first I did a quick test with an existing database, Northwind to be exact, and it worked pretty well. For each table a 2 classes are generated, the first is the entity class itself. The second is a map class that defines the mapping between the entity and the database. Another thing I noticed was that the entities only have their collection properties marked as virtual. Adding Ef4.1 Enjoy! The Problem Solver - Thursday, May 19, 2011 - Entity Framework 4 : ContextOption.LazyLoadingEnabled
Entity Framework 4 enables lazy loading of entities by default. This is especially true if you’re connecting to a database. So using Entity Framework your code may look something like this: 1: using ( MyEntities db = new MyEntities () ). 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’). BUT hold on, the ‘using’-statement has already disposed of the object context and closed the database connection. The Blomsma Code - Tuesday, January 18, 2011 %>
| | |