entity-framework-6 Questions

5

Solved

I'm trying to create a EF 6.4 migration in my solution which has net472 projects and netstandard projects, and I'm getting the following error: Project 'ESP.Console' targets framework '.NETStandar...
Incardination asked 2/7, 2020 at 18:5

4

I have a data call in a Linq to Entities powered data access layer that is designed to make paged calls. In doing so, I need to select a subset of the data, say 50 rows, but also get the count of ...
Mosenthal asked 23/3, 2015 at 18:54

3

I have multiple SQL server tables that are the same, but differ in content. In writing a code first EF6 program I am trying to reuse the same db context for each and pass in the table name to the c...
Landis asked 8/3, 2018 at 14:14

2

Solved

I am trying to learn about Entity Framework 6, and I am running into an issue, that I have been able to reproduce in a test project: A Movie has a Nameand a Revenue. A Revenue has a GrossIncome: ...
Denbighshire asked 7/2, 2019 at 16:49

2

Solved

When using a Database Initializer for Entity Framework 6 that creates a database when none exists with an Azure SQL server connection the Database created is created using the vCore pricing model. ...
Beira asked 30/10, 2019 at 15:33

5

Solved

I'm developing a plugin application with EF6, code first. I have one main context with an entity called User: public class MainDataContext : DbContext { public MainDataContext(): base("MainDataC...

12

For a couple of months i had no issue generating the model from DB by deleting it and recreating it . After a pull from git, an issue has been occurred while trying to make the same process . After...
Fornix asked 4/4, 2019 at 6:59

2

Solved

Entity Framework 6, MVC5, ASP Identity 2.0. I'm new to Entity framework and ASP Identity. I've created database with Code First approach, following these instructions: http://dotnetcodr.com/2014/...

7

Solved

Code First Environment I'm trying to update the database from package Manager console. If my domain class changes, I have to drop and create the database. Instead of dropping the database, how can ...

4

Solved

I have CreatedAt and UpdatedAt columns in my User model. User.cs public string Name { get; set; } public DateTime? CreatedAt { get; set; } public DateTime? UpdatedAt { get; set; } Requirement ...
Rottenstone asked 1/8, 2017 at 5:38

2

Solved

I'm working in a project that uses EF Code First. I'm trying to use migration features. I don't want to use Package Console Manager. How can I execute the "Add-Migration" and "Update-Database" prog...

7

Solved

I have some codes like below, I want to write unit tests my method. But I'm stuck in async methods. Can you help me please ? public class Panel { public int Id { get; set; } [Required] public d...

2

Solved

I've been using Entity framework code first in a project and all the tables have been created /modified a while ago. Now I need to add an unique constraint to a table. I want to create a migration ...

14

I have multiple DbContexts in a C# project and I'm trying to enable migrations. When I specify the full command, i.e.: Enable-Migrations -ContextTypeName Models.Account.AccountDetailDbContext A mi...
Mouthful asked 17/8, 2016 at 16:10

15

Solved

I am attempting to create an Entity Data Model using the wizard to reverse engineer an existing MySQL database. I get to the Choose Your Data Connection page of the wizard, select an existing MySQL...
Guttering asked 23/8, 2016 at 20:22

11

Solved

I've added a new .Net 6.0 project to my solution in VS2022. Installed the EntityFramework 6.4.4. with install-package entityframework and now try to add a ADO.Net Entity Framework Model to the proj...
Timbrel asked 4/1, 2022 at 15:8

2

Solved

I have been trying to follow this tutorial ... http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application but I keep g...

4

Solved

I cannot seem to resolve what appears to be a common issue with Entity Framework 6. I have reviewed the many topics related to this issue on SO, and am unable to find a solution that works for my p...
Veroniqueverras asked 5/9, 2015 at 17:48

6

Solved

I'm looking for an elegant way to execute a Contains() statement in a scalable way. Please allow me to give some background before I come to the actual question. The IN statement In Entity Framewor...
Barling asked 2/7, 2014 at 14:47

1

I have two DbContext in my project, i am trying to run EF Add-Migration pointing to a specific DbContext, but i have being encountering the below error. Add-Migration Initial -ContextTypeName Syst...
Ground asked 13/4, 2019 at 0:39

5

Solved

I have upgraded from EF 4.3.1 to 6.1.1 and now it seems like the annotation [NotMapped] is useless. Yes, i have change to correct assembly and everything looks fine on compilation. Everywhere wher...
Buhler asked 3/9, 2014 at 14:18

2

With EF I used DbEntityValidationException catch branch (along with others) catch (DbEntityValidationException exception) { // any statements here... throw; } Now using .NET Core 3.17 with EF Co...

30

Solved

I created an MVC 5 application in VS 2013 Professional and then used EF 6.1 code first with an existing DB on SQL Server Express. When I try to create the views I’m using the “New scaffolded item…”...

13

Solved

I have a model class named Foo that has, among others, these properties. public string StripeRecipientId { get; set; } public override bool HasProvidedBillingInformation { get { // return !str...
Bearish asked 29/9, 2015 at 13:31

3

I know there is a problem with EF6 EntityFramework.SqlServer and included var type = typeof(System.Data.Entity.SqlServer.SqlProviderServices); in context constructor. It works fine when i do publis...
Elka asked 21/8, 2014 at 18:17

© 2022 - 2025 — McMap. All rights reserved.