Questions tagged as 'entity-framework-core'

1
answer

Error Entity Framework Core

I have an error with Entity Framework core when I add Migration, the following error appears to me: System.InvalidOperationException: Cannot use table 'Atleta' for entity type 'Pessoa' since it is being used for entity type 'Atleta' and th...
asked by 08.03.2018 / 17:16
2
answers

EF core procedure call

I'm trying to use the entity-framework -core and I'm having a problem, I need to call a procedure : var status = _context.Set<Usuario>().FromSql("exec LoginUsuario @chave='ROBr', @senha=null,@fonteConfiavel=0").ToList(); Error...
asked by 30.05.2018 / 19:15
0
answers

How to use interfaces like DbSet's in the Entity Framework in C #

Hello, I'm doing a solution where my entire business layer is in a separate project and in this project I created the relational layer structure from interfaces as shown in the example below: // interfaces de definição de características publ...
asked by 17.10.2018 / 14:14
2
answers

Return data from a query with Linq in an EF Core repository

I have the Person class that relates to the PersonPhysical and PersonJuridica tables in a one-to-one relationship. In my Person table I have the Field PersonNature where 0 = Individual and 1 = Legal Entity. A person can be physical or legal a...
asked by 15.02.2018 / 21:05
0
answers

Error using dictionary in an IQueryable.Select () method to design chosen columns at runtime

The code fragment below is intended to use the Select () method to perform generic column projections on a query, according to a list of given column names. The program works fine if all the columns are of type 'string', but triggers the excepti...
asked by 16.06.2017 / 21:32
1
answer

The entity type 'Personal' is part of a hierarchy, but does not have a discriminator value configured

I'm trying to generate migrations using the command: dotnet ef migrations add InitialMigration --context MyContext and the same is returning me the following message.    System.InvalidOperationException: The entity type 'PersonPass' i...
asked by 08.11.2016 / 18:01
1
answer

How to enable Migrations using the Entity Framework Core = Windows Forms C #

I'm testing EF Core in a Windows forms project following the DDD standard. In the repository layer I created my context and in my domain I already have the defined Models classes. How do I activate Migrations in EF Core so that I do not have to...
asked by 22.03.2017 / 00:33
1
answer

Circular relationship with EntityFramework Core

I need to relate the Person with Person entity to the Person using the EF Core, but is giving the following error in Migrations:    "The navigation property 'PersonFilial' can not be added to the entity type 'PersonCadastro' because a propert...
asked by 21.12.2017 / 00:29
1
answer

How to show queries generated by EF core

A while ago, with a simple code within my context, it would display the queries generated by EF6 in the console or even write to a txt file ... However, today I use the Entity Framework Core in an asp.net core (MVC) application and wanted to...
asked by 03.10.2018 / 14:39
1
answer

Map classes that inherit the Id of another Entity class - EF Core

I need to map the Person and Branch classes with one-to-one relationship, where a person will be just a branch and a branch will be linked to only one person, (A PK in Person ID and PK / FK in Branch ID). The Entity Framework Core is getting con...
asked by 17.01.2018 / 21:37