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

Entity Framework Core - Knowledge Base (KB)

240 results for: in tag: ef-code-first

EF code-first: How to load related data (parent-child-grandchild)?

I have this entity:...public class DynamicPage { public int PageId { get; set; } public int Order { get; set; } public string MenuText { get; set; } public string MenuHover { get; set; } public int? ParentId { get; set; } pub...
ef-code-first entity-framework entity-framework-4.1 entity-framework-5 entity-framework-6
asked by ravy amiry

Entity Framework and Migration with multiple schemas in a single Context

I am developing a multi-tenant application with Entity Framework Code First. Each tenant will have a different schema in the database, but the application will have a single Context and model for all tenants. ...The Entity Framwork 6 is able to use multi...
c# ef-code-first entity-framework entity-framework-6
asked by Bruno Albano de Souza

What is the correct use of IDatabaseInitializer in EF?

I have a custom DatabaseInitialiser which is below.../// <summary> /// Implements the IDatabaseInitializer to provide a custom database initialisation for the context. /// </summary> /// <typeparam name="TContext">TContext is the DbContext</typeparam> pub...
c# ef-code-first ef-migrations entity-framework entity-framework-6
asked by ashutosh raina

In Entity Framework, why isn't lazy loading working for a one-to-zero-or-one navigation property?

Consider ...Person... and ...Address... classes defined as...class Person { public int PersonId { get; set; } public virtual Address Address { get; set; } } class Address { public int PersonId { get; set; } public virtual Person Person { get; set...
ef-code-first entity-framework entity-framework-5 entity-framework-6 lazy-loading
asked by Mike

Entity Framework 6 Code First function mapping

I want integrate Entity Framework 6 to our system, but have problem....I want to use Code First. I don’t want to use Database First *.edmx file for other reasons....I use attribute mapping [Table], [Column] and this works fine...Database has many User-D...
c# ef-code-first entity-framework entity-framework-6 sql-function
asked by Alexey

The type 'Company.Model.User' and the type 'Company.Core.Model.User' both have the same simple name of 'User' and so cannot be used in the same model

I have a base entity class ...MyCompany.Core.Model.User... which is to be used for common properties of a ...User... entity:...public class User { public string Username { get; set; } public string Usercode { get; set; } } ...I also have a base ma...
ef-code-first entity entity-framework entity-framework-6 inheritance
asked by Brett Postin

How to change the naming convention of Many-to-Many table relationships?

How can I go about changing the naming convention of the auto-generated many-to-many table?...Assume I have two classes:...public class User { public int UserId { get; set; } public virtual List<Role> Roles { get; set; } } public class Role { ...
ef-code-first entity-framework entity-framework-6
asked by Nathan A

How to resolve Warning : The element 'entityFramework' has invalid child element 'providers'. List of possible elements expected: 'contexts'

I'm playing around with EF different workflows. Yesterday I made a new project and ...Entity Framework 6... was the first suggestion from ...Nuget... so I decided to give it a try, also it is a very small project entirely for learning purposes so I guess ...
ef-code-first entity-framework entity-framework-6 visual-studio-2012
asked by Leron_says_get_back_Monica

Nullable fields are created when customizing IdentityUser class in asp.net Identity

I am trying to customize IdentityUser class in asp.net identity....public class ApplicationUser : IdentityUser { public ApplicationUser() { IsBlocked = false; } public bool IsBlocked { get; set; } } ...The problem is: when using c...
asp.net-identity ef-code-first entity-framework entity-framework-6
asked by aleyush

Entity Framework: The provider did not return a providermanifest instance

Entity Framework 6.0.1 my App.config:...<?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> <section name="e...
c# ef-code-first entity-framework entity-framework-6 sql-server
asked by Temaska

Save detached object graph using Entity Framework code first causes Primary Key violation

I'm trying to save an object graph of POCOs I have mapped to EF6 using Code First fluent notations....Upon saving the object graph however, I stumble upon primary key violation exceptions....The object graph is quite simple:...One ...Issue... can contain ...
c# ef-code-first entity-framework entity-framework-6 primary-key
asked by Robert Sirre

How can set a default value constraint with Entity Framework 6 Code First?

In a legacy app, most string properties can't be null and need to have a default value of string.empty....I know it's possible to do this with migrations, but I'm looking for a way to do this using the fluent configuration interface:... protected overr...
.net c# ef-code-first entity-framework entity-framework-6
asked by ECC-Dan

How to avoid Lazy Loading when accessing foreign key ID property through navigation property?

I'm in the process of converting a project from NHibernate to Entity Framework 6....Given this simple model: ...public class User { public int ID { get; set; } public string FullName { get; set; } public virtual Organization Organization { get...
c# ef-code-first entity-framework entity-framework-6
asked by ECC-Dan

Issue loading child entity of a parent entity. Unidirectional mapping and 1 to 0..1 relationship with a Shared primary Key?

When I try to load child entity of parent entity it loads with default values. If i try to load explicitly it throws exception ...Multiplicity constraint violated.... The role 'Association_Customer_Target' of the relationship 'CodeFirstNamespace.Associati...
ef-code-first entity-framework entity-framework-6 entity-framework-ctp5
asked by Mady

IsRowVersion can only be configured for Byte array properties

I recently upgraded from EntityFramework 5 to 6 via the NuGet updater. Everything seemed to go well and I built and executed my application. When I tried to retrieve the first entity from the database, I received this error:...The property 'UpdatedDate' i...
c# ef-code-first entity-framework entity-framework-6
asked by Sparafusile

EF6 Code First Pluralizing Tables Invalid Object Name

EF6 is pluralizing my Code First table names no matter what I do. I am getting the error that it can't find the pluralized table {"Invalid object name 'dbo.TestStats'."}. The table is singular in the DB as dbo.TestStat...I tried removing the convention by...
ef-code-first entity-framework entity-framework-6
asked by Shiloh

Unable to find the requested .Net Framework Data Provider. It may not be installed

This morning I suddenly got this exception when trying to add a custom migration step to our EF Code-first migrations:...The ADO.NET provider with invariant name '.NET Framework Data Provider for SQL Server' is either not registered in the machine or appl...
ef-code-first ef-migrations entity-framework entity-framework-6
asked by Jesper Lund Stocholm

Foreign key issues in EF6 CF

Excuse me for being a noob with EF when it comes to code first. My problem is I don't want to add foreign key properties to the model and according to MSDN this presents no problem using the fluent API, however I can not figure out the correct use for my ...
c# ef-code-first ef-fluent-api entity-framework entity-framework-6
asked by weagle08

Entity framework code first migration to multiple database

Lets say we have the architecture model of web application where we have 1 database per 1 account. Database structure is the same for these accounts and differs only on data with in. How can i configurate a migrations in code first model.
code-first ef-code-first ef-migrations entity-framework entity-framework-6
asked by Vitach

Why is ON DELETE SET NULL still not implemented in the Entity Framework 6? Is there a snag?

It still is not possible to configure a relation with the ON DELETE SET NULL rule using Entity Framework code first. As a workaround you have to load all the related entities in memory and ...then... on deletion of the parent entity EF will issue SQL comm...
ef-code-first entity-framework entity-framework-6
asked by Dabblernl

Page 1 of 12
  • 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