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)

299 results in tag: asp.net-core-mvc

DbContext Not Found or A relational store has been configured without specifying either the DbConnection or connection string to use

when using Entity Framework Commands ("7.0.0-beta1")....when running...k ef migration add InitialCreate...i'm getting errors....[Solution]...i try to move my Class File (where DbContext is created) to main project from separate class library and everythin...
asp.net-core asp.net-core-mvc entity-framework-core
asked by Vijayant Katyal

How to run stored procedures in Entity Framework Core?

I am using EF7 (Entity Framework Core) in an ASP.NET Core App. Can you please point me to the proper way of executing stored procedures? The old method with ...ObjectParameters... and ...((IObjectContextAdapter)this).ObjectContext.ExecuteFunction... is no...
asp.net-core asp.net-core-mvc entity-framework-core
asked by eadam

ASP.NET MVC 6 - Assigning NOT NULL to the Primary Key in Entity Framework 7

Code:...migrationBuilder.AddPrimaryKey("AspNetRoles", "PK_AspNetRoles", new[] { "Id" }, isClustered: true); ...I am getting the error message as ...Cannot define PRIMARY KEY constraint on nullable column in table 'AspNetRoles'....Namespace of MigrationBui...
asp.net asp.net-core-mvc c# entity-framework-core
asked by Programmer

How to run dynamic SQL query in Entity Framework 7 that auto-maps to Entities (SqlQuery<T>)?

I have an existing app that I am trying to upgrade from MVC5/EF6 to MVC6/EF7. We dynamically create some of our SQL tables, and as a result, have made use of the...System.Data.Entity.Database.SqlQuery ...method to automatically map to entities that we us...
asp.net-core-mvc entity-framework entity-framework-core
asked by Hayaku77

ASP.NET 5 MVC 6 and Entity Framework 7 issues

We can't add Owin and Entity framework 7 together. As we do so then there will be ambiguity between Microsoft.AspNet.Identity.core 2.0.0.0 and Microsoft.AspNet.Identity 3.0.0 Beta1...And hence I am not able to implement role provider in my application to ...
asp.net-core asp.net-core-mvc c# entity-framework-core
asked by sanjaypujari

How to configure an Identity column using Entity Framework Core?

How do I create an Auto increment identity column in Entity Framework Core?...Obviously I can do it using fluent API for EF6 for example.
c# entity-framework-core
asked by Andrew Duffy

Adding DbContextOptions in Startup.cs not registering data store

My problem is that the below code does not register a data store during startup. This is the specific "error" statement I get in the response from the application:...An unhandled exception occurred while processing the request. InvalidOperationException:...
asp.net-core-mvc c# dependency-injection entity-framework entity-framework-core
asked by DanielRJ

Include several references on the second level

Assume we have this model :...public class Tiers { public List<Contact> Contacts { get; set; } } ...and...public class Contact { public int Id { get; set; } public Tiers Tiers { get; set; } public Titre Titre { get; set; } public TypeC...
asp.net-core-mvc entity-framework-core
asked by Christophe Gigax

EF7 contructor with MVC6 dependency injection

Testing out the new MVC6 and EF7 framework....We often need the HttpContext in our database layers. To do this in MVC6 we simply have a DbContext constructor that looks like this:... public class ApplicationDbContext : IdentityDbContext<ApplicationUser> ...
asp.net-core-mvc c# dependency-injection entity-framework entity-framework-core
asked by Feech

Loading of references in EF7

I'm having two classes - author and blogpost:...public class Author { public Author() { Blogposts = new HashSet<Blogpost>(); } public int Id { get; set; } public string Name { get; set; } public virtual ICollection<Blogpos...
asp.net-core-mvc entity-framework-core
asked by Peter Albert

db.database.ExecuteSQLCommand equivalent in EF 7

Whats the equivalent of ...db.Database.ExecuteSqlCommand(Sql.ToString()); ...in Entity Framework 7? I saw .FromSQL() in beta 4, but haven't seen anything to the above.
asp.net-core asp.net-core-mvc entity-framework entity-framework-core
asked by NicoJuicy

Entity Framework 7 group by

I'm trying to run the following code but when I check the SQL profiler it looks like it runs a full select on the table and then does the grouping after it returns all results from the database. Any help is appreciated. ... var result = _dbContext.LogEve...
asp.net-core asp.net-core-mvc entity-framework-core
asked by RickJames

Override Default Identity Table Names

I would like to rename the default identity table names:...AspNetRoles...AspNetUserClaims ...AspNetUserLogins ...AspNetUserRoles...AspNetUsers...I understand how to do this using EF6:... protected override void OnModelCreating(System.Data.Entity.DbModelBu...
asp.net-core asp.net-core-mvc asp.net-mvc entity-framework-core
asked by Reafidy

Update Database after Model Changes - Entity Framework 7

I have created an app using the lastest ASP.NET5 MVC 6 Entity Framework 7 and setup migrations using ...dnx . ef migration add Initial dnx . ef migration apply ...This works but when I make a change to the model the database is not updated. I would lik...
asp.net-core-mvc asp.net-mvc c# entity-framework entity-framework-core
asked by Reafidy

How to Inject Dependency of ApplicationDbContext in Repository MVC6

I'm using Asp.Net MVC 6 beta4 with Repository Pattern....In the my Startup.cs I have someting like this:...services.AddEntityFramework() .AddSqlServer() .AddDbContext<ApplicationDbContext>(options => ...
asp.net-core-mvc asp.net-mvc entity-framework-core
asked by Renatto Machado

Getting sqlite to work in ASP.NET 5 (vnext)

I'm trying to get "EntityFramework....SQLite...": "7.0.0-beta1" to work within ASP.NET 5....I've created my project using Yeoman and installed EF sqlite from the package manager....The project builds fine but when running I get:...Could not load file or a...
.net-core asp.net asp.net-core-mvc entity-framework-core sqlite
asked by ryan g

MVC6 Access DbContext From Classes Not Related To Controller

I am developing a ASP.Net5 MVC6 website Using EF7....I wanted to access DbContext from one of my classes which is not being called from Controller....Is it possible to access from there? If yes then please guide me a little so that I can learn how to do i...
asp.net-core-mvc entity-framework-core
asked by Steve

Migrating to MVC6 / EF7: PluralizingTableNameConvention

I'm migrating my MVC5 app to MVC6. Currently I'm using two conventions... public class RentABikeDbContext : DbContext { ... protected override void OnModelCreating(DbModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); ...
asp.net-core-mvc entity-framework-core
asked by Sergey Kandaurov

Define an Entity with a Unique Key at the Model Level

Using asp.net 5 entity framework 7, I would like to define a field with a unique key constraint at the model level. I am not talking about a primary key. I believe in EF 6 it used to be something like this:... [Key] public int Id{ get; set; } ...
asp.net-core asp.net-core-mvc c# entity-framework-core
asked by Reafidy

Error running application using EF 7 after adding dependencies and updating model classes

I am running MVC 6 and EF 7 and have changed my models and wish to run the application, however I receive an error and it is not clear what the root cause is....below is a snippet from my project.json..."dependencies": { "EntityFramework.Commands": "7.0.0...
asp.net-core-mvc entity-framework-core
asked by John Fleming

Page 1 of 15
  • 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
Get monthly updates by subscribing to our newsletter!
SUBSCRIBE!