zzz projects Entity Framework 6 EF 6
Home EF Core Articles Knowledge Base Online Examples
  • Home
  • EF Core
  • Articles
  • Knowledge Base
  • Online Examples

Entity Framework 6 - Knowledge Base (KB)

563 results in tag: ef-code-first

EF Code First's decimal accuracy and scale

I'm experimenting with this code-first approach, but I'm find out now that a property of type System.Decimal gets mapped to a sql column of type decimal(18, 0). ...How do I set the precision of the database column?
.net c# decimal ef-code-first entity-framework
asked by Dave Van den Eynde

Entity Framework 4 Code First demonstrates how to declare a one-to-one connection (POCO)

How to declare a one to one relationship using Entity Framework 4 Code First (POCO)?...I found ...this question (one-to-one relationships in Entity Framework 4) ..., but the article that the answer references was not useful (there is one line of code that...
c# ef-code-first entity-framework one-to-one poco
asked by Paul Hiles

What happened to my DbContext DbSet?

I created a new Entity Frameworks Code First app and the DbSet (People) is returning null....public class Person { public int Id { get; set; } public string Name { get; set; } } public class Repository : DbContext { public DbSet<Person> Peopl...
code-first ef-code-first entity-framework
asked by Jamey McElveen

InvalidOperationException is thrown by EF4 Code-First.

I'm having an issue when trying to run my project each time it builds. It seems the initializer runs, but when it comes to the first query - it dies with the following ...InvalidOperationException.......This operation requires a connection to the 'master'...
c# code-first database ef-code-first entity-framework
asked by Amadiere

Seed technique no longer works in EF4 Code First CTP5

I had EF Code First CTP4 working fine, and I installed CTP5 today. Now, I get an exception when my database is repopulated....Here is my model:...public class Member { public Member() { DateCreated = DateTime.Now; DateUpdated = Da...
c# ef-code-first entity-framework
asked by Dave

Using Entity Framework ExecuteStoreQuery to return a DataTable

I am working with a system that has many stored procedures that need to be displayed. Creating entities for each of my objects is not practical. ...Is it possible and how would I return a ...DataTable... using ...ExecuteStoreQuery... ?...public ObjectResu...
code-first ef-code-first entity-framework stored-procedures
asked by detroitpro

On database creation, how do I input data in Entity Framework code first?

I'm using code first entity framework and I would like to know how to run some code when the database is being created so that I can populate my database with some data. (note that I'm asking for on database creation, not everytime the application starts)...
code-first ef-code-first entity-framework
asked by ajma

How can I use Entity Framework Code First CTP 5 to store images?

I'm just trying to figure out if there is a simple way to store and retrieve binary (file) data using EF Code First CTP 5? I would really like it to use the FILESTREAM type, but I'm really just looking for some way to make it work.
.net ef-code-first entity-framework sql-server-2008
asked by Max Schmeling

In EF Code First, how do I singularize my tables?

I prefer using singular nouns when naming my database tables. In EF code first however, the generated tables always are plural. My DbSets are pluralized which I believe is where EF is generating the names but I don't want to singularize these names as I...
ef-code-first entity-framework
asked by trevorc

In EF Code First, what is the syntax for self-referencing foreign keys?

I am trying to reference a foreign key from SpouseId to Id in the Contact table. What is the syntax for doing this? I can't seem to find an example. Thanks....I have a class like this:...public class Contact { public int Id {get;set;} public st...
ef-code-first entity-framework
asked by trevorc

From the EF Code-First DbContext class, create a SQL CE database.

I've defined a set of classes in the style of Entity Framework Code-First conventions and annotated the class properties with System.ComponentModel.DataAnnotations attributes....Now I want to generate a SQL Server Compact Edition (SCSE) (4.0) database fro...
.net code-first ef-code-first entity-framework sql-server-ce
asked by Bent Rasmussen

How do I tell a property to create a TEXT column instead of a nvarchar? (4000)

I'm working with the Code First feature of Entity Framework and I'm trying to figure out how I can specify the column data types that should be created when the database is auto-generated....I have a simple model:...public class Article { public int A...
c# data-annotations ef-code-first entity-framework sql-server-ce
asked by Mark Bell

For the present context, the entity type classname> is not included in the model.

DB has a table ...PackagingInfo.... I have a ...Package... class, and a ...ShopEntities : DbContext.......// Entity (ex. Package.cs) [Table("PackagingInfo")] public class Package { public decimal PackageID { get; set; } public decimal Title { get;...
ef-code-first entity-framework
asked by maryam

Creating a new DbEntityEntry or mocking or simulating a DbEntityEntry

Following on the heels of my other ...question about mocking DbContext.Set... I've got another question about mocking EF Code First....I now have a method for my update that looks like:...if (entity == null) throw new ArgumentNullException("entity"); ...
ef-code-first entity-framework
asked by taylonr

"CategoryCategoryID" is an incorrect column name in the EF Code.

There is a existing database named Northwind with a webform application. when running the application raise up a error: 'invalid column name CategoryCategoryID'. any one help me?. thanks in advance!!...Category.cs:...public class Category { public in...
ef-code-first entity-framework
asked by user441222

WPF MVVM modeling using Entity Framework CTP5 Code First

I have my model all setup for my WPF application and working with entity framework ctp5 code first, here's a sample model class:...public class Task { public int ID { get; set; } public int Index { get; set; } public string Content { get; set;...
code-first ef-code-first entity-framework mvvm wpf
asked by Chris Klepeis

Include method with Many to Many table in EF Code First CTP5

I have something like the following many to many relationship tables....public class Shop{ public int Id { get; set; } public virtual ICollection<ShopFacility> ShopFacilities { get; set; } } public class ShopFacility { public int Id { get; set; } ...
ef-code-first entity-framework linq-to-entities
asked by Yoo Matsuo

Entity Framework 4 Code First error: database in use

I have an MVC3 and EF 4 Code First application, which is configured to change the DB when the model changes, by setting the DB Initializer to a ...DropCreateDatabaseIfModelChanges<TocratesDb>..., where ...TocratesDb... is my derived ...DbContext.......I h...
code-first ef-code-first entity-framework sql
asked by ProfK

Is it possible to use code-first Entity Framework with SQL Server databases on the same machine?

I know there have been a lot of questions about Entity Framework doing cross database queries on the same server posted to ...stackoverflow.... Mostly the answer seems to be 'no', and this link from ...way back in 2008 is referenced.... However, Entity F...
ef-code-first entity-framework sql-server
asked by mattmc3

What is the difference between.WithMany() and.WithOptional()?

Below are two similar fluent API configurations:...WithMany()...modelBuilder.Entity<Country>() .HasRequired(cou => cou.Currency) .WithMany() .WillCascadeOnDelete(false); ...WithOptional()...modelBuilder.Entity<Country>...
ef-code-first entity-framework fluent-interface
asked by Ingmar

Page 1 of 29
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • …
  • »
  • »»

Prime Library

Performance

  • Entity Framework Extensions
  • Entity Framework Classic
  • Bulk Operations
  • Dapper Plus

Expression Evaluator

  • C# Eval Expression
  • SQL Eval Function
More Projects...

Related

  • EF Extensions Online Benchmark
  • WIN an EF Extensions license
  • EF6 BatchSaveChanges for only $79
Save your entities 20× faster with EF Extensions
SaveChanges vs BulkSaveChanges

EF Extensions
Try for free now
Get monthly updates by subscribing to our newsletter!
SUBSCRIBE!