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

Entity Framework Core - Knowledge Base (KB)

6642 results

Does EF Core SaveChanges validate against the data annotations

I have a model with Data Annotations and I was wondering if it was possible to have the SaveChanges method fail if the Data Annotation failed?...I was expecting SaveChanges to throw an exception along the lines of "Test2 is outside the Range of 2 to 4". ...
c# data-annotations entity-framework-core
asked by VorSiechtIP

Dynamically changing schema in Entity Framework Core

UPD...here... is the way I solved the problem. Although it's likely to be not the best one, it worked for me....I have an issue with working with EF Core. I want to separate data for different companies in my project's database via schema-mechanism. My qu...
asp.net-core c# database-schema entity-framework entity-framework-core
asked by user3272018

How to select item with specific item in iCollection property?

I have the following class: ... public class Foo { [Key] public int ID { get; set; } public virtual ICollection<Cat> Cats { get; set; } } ...I am trying to select all the Foo objects which contains a specific Cat object. ...
c# entity-framework entity-framework-6
asked by Ayorus

Error ASP.NET Core EF Core and SQL Server 2005: The version of SQL Server in use does not support datatype 'datetime2'

I receive the following exception when attempting to update a database record even though I was passing in the correct datetime values to the controller....System.ArgumentException: The version of SQL Server in use does not support datatype 'datetime2'...
asp.net-core-mvc entity-framework entity-framework-6 sql-server-2005
asked by gadgetguy

Setting -TargetMigration with EF core

I am trying to target a previous applied migration using ...dotnet ef -TargetMigration: {MigrationName}...getting below error...Unrecognized option '-TargetMigration:0'...Is this command has been removed in Entity Framework Core? Is there any alternative...
.net-core ef-migrations entity-framework-core
asked by Venky

EntityFramework Core automatic migrations

Is there any code to perform automatic migration in ...Entity Framework core...code first... in asp.net core project?...I do it simply in MVC4/5 by adding...Database.SetInitializer(new MigrateDatabaseToLatestVersion<AppDbContext, MyProject.Migrations.Conf...
asp.net-core entity-framework entity-framework-core
asked by Lapenkov Vladimir

.net core entity framework (EF Core) table naming convention

.net core entity framework (EF Core) table naming convention plural to single/simple/underscore...Being a fan of ...single simple underscore... naming convention to table names, I feel uncomfortable with the way ...EF core... is naming tables ...Plural Pa...
c# entity-framework entity-framework-core
asked by Faraj Farook

EF Core custom count query

I'm working on a small ASP.NET Core project for tagging images using Entity Framework Core on a Sqlite database, mainly just for learning. There are two tables (and POCOs), Tags and Images, where multiple tags are related to each image. I'm trying to get ...
asp.net-core c# entity-framework-core linq
asked by Daniel Dreier

Get the ApplicationUser in a controller

I am googleing for get the application user in a controller in ASP.NET Identity 3.0 but I only find results for 5 and lower....I am trying to get the ...ApplicationUser... properties but I can't get the ...ApplicationUser... at all. I guess it is easy bec...
asp.net-core c# entity-framework-core identity
asked by StuiterSlurf

Identity DB context / hint no plural tables

I have an existing DB context that worked well so far with EF configuration as below... protected override void OnModelCreating(DbModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); // Configure Code First t...
asp.net-mvc asp.net-mvc-5 c# entity-framework entity-framework-6
asked by Krishna

EntityFramework 6.0.0.0 reads data, but it is not inserting

I've created a ...Service-based Database...folderName->Add New Item->Data->Service-based Database... file into WPF application. Then I've used ...Database First... approach and have created the ...PersonsModel.edmx... file. These operations are executed p...
c# entity-framework entity-framework-6 wpf
asked by StepUp

Entity Framework 6 creates Id column even though other primary key is defined

I defined a DataObject as:...public class SensorType : EntityData { //PKs public string CompanyId { get; set; } public string ServiceId { get; set; } public string Type { get; set; } } ...And used fluent API to make CompanyId and ServiceI...
c# data-annotations ef-fluent-api entity-framework entity-framework-6
asked by Emil Nyborg

Consider using IDbContextFactory to override the initialization of the DbContext at design-time

On an ASP.NET Core 1.0.1 project, using Entity Framework Core and ASP.NET Identity, I have the following context:...public class Context : IdentityDbContext<User, Role, Int32, UserClaim, UserRole, UserLogin, RoleClaim, UserToken> { public Context(DbCon...
asp.net-core asp.net-identity-3 c# entity-framework-core
asked by Miguel Moura

Is base.OnModelCreating(modelBuilder) necessary?

I'm overriding ...OnModelCreating..., and in the method there's the line ...base.OnModelCreating(modelBuilder);...protected override void OnModelCreating(DbModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); } ...Looking at code samples a...
entity-framework entity-framework-6
asked by Garth Marenghi

Do I use Snapshot file, migration file or data annotations in my EF Core to update database?

I'm trying to understand the different types of migration paths we can choose when developing an ASP.NET Core 1.0 application with EF Core. When I created my first Core application I noticed it generated a ApplicationDbContextModelSnapshot class that uses...
asp.net-core entity-framework-core
asked by Ray

Cannot connect to SQL Server on ASP.NET Core 1 EF7

I am trying to connect to SQL Server 2014 or 2016 from an ASP.NET Core 1.0 web application (Entity Framework Core). I am getting the error below. Any tips how to resolve it....I can successfully connect to the DB from through Visual Studio 2015 SQL Server...
asp.net-core asp.net-core-1.0 entity-framework-core sql-server
asked by feradz

How do you make foreign key as NOT NULL in EF Core migrations with Data Annotations?

I'm using ASP.NET Core and EF Core and I have the two following parent and child classes. Each gift card can have many transactions:...public class GiftCard { public int Id { get; set; } public string BarCode { get; set; } public DateTime Purc...
ef-migrations entity-framework-core
asked by Ray

Invalid Column name when using savechanges() in entity framework

So here is the deal, I have changed my database schema, and changed the PK for one of my tables and I have removed everything related to the old PK (FK reference in another tables). ...However I have this exception when I insert a new entity using savecha...
asp.net-mvc ef-database-first entity-framework entity-framework-6 sql-server
asked by SaadK

Entity Framework: Creating entities from Oracle View

I've been having this issue for over a week, and I know there are lots of questions about this, but I haven't seen one using Oracle. I'm using EF Database First, I need to create an entity from a Oracle View and because of the "You need to define a primar...
entity-framework entity-framework-6 oracle
asked by ggderas

Where is the EDMX

Getting exposed to dotnet Core. In a sample test application trying to setup EntityFramework.Core in dotnet core app. While I was able to add the EntityFramework.Core NugGet package I can't find the 'Add'->'New Item'->'Data'->'ADO.NET Entity Data Model'...
.net .net-core entity-framework-core
asked by barrypicker

Page 79 of 333
  • ««
  • «
  • …
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • …
  • »
  • »»

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
Get monthly updates by subscribing to our newsletter!
SUBSCRIBE!