Questions tagged as 'entity-framework-core'

0
answers

Add-Migration Not Being Run .NET Core 2.0 EntityFrameworkCore 2.1.3

   When doing the Add-Migration "Initial" Migration classes are not being performed, can anything be related to the connection to the database? because when I run the command no error is given, and the console prompt is available to run new comm...
asked by 26.09.2018 / 21:43
0
answers

How to include tables in a one to one EF Core relationship

I need to include the highlighted blue tables for EF Core to make the necessary joins. The PersonFishDocument table has a one-to-one relationship with the highlighted blue tables. I've already tried using .ThenInclude, but the PersonFishDocum...
asked by 01.10.2018 / 00:04
1
answer

Error while executing Add-Migration Setup

When executing the Add-Migration Setup command to create the table in SQL Server in the PM the message below occurs even though I do the api project reference with the shared. The system even gets to process something, but soon gives this erro...
asked by 05.10.2018 / 15:42
0
answers

Add-Migration Not Being Run .NET Core 2.0 EntityFrameworkCore 2.1.3

   When doing the Add-Migration "Initial" Migration classes are not being performed, can anything be related to the connection to the database? because when I run the command no error is given, and the console prompt is available to run new comm...
asked by 26.09.2018 / 21:43
2
answers

How to configure PostgreSQL AutoIncrement using EF Core

I have a table mapping (Entity Framework Core 2.0) in which the Id field needs to be AutoIncrement. The problem is that PostgreSQL is starting with high value and often jumps to very high sequences, type, increasing by 10 from 10. What am...
asked by 21.09.2018 / 23:49
1
answer

Entity Framework Core 2 - Recursive search in many-to-many relationships

I made a many-to-many relationship using EF Core 2, Code First method. > in this link , you need to create a join entity: public class ClienteModel { public int ClienteId { get; set; } public string NomeEmpresa { get; set; } publ...
asked by 05.09.2018 / 01:08
0
answers

Problem in saving many-to-many relationship with Entity Framework Core

I'm having trouble saving a many-to-many relationship with Entity Framework Core I have the following entities [Table("quadros")] public class Quadro : BaseEntity { public bool Ativo { get; set; } public string Titulo { get; set; }...
asked by 03.09.2018 / 03:08
2
answers

Change a generic repository method to return with AsNoTracking - EF Core

I have a generic repository, in particular, the GetbyId method, in which I want to change it to return a result with AsNoTracking or No, as needed. How do I do this? My Interface: TEntity GetById(int id, bool @readonly = false...
asked by 23.08.2018 / 18:43
0
answers

Map a table and enable Auto-increment of an FK field in PostGre using EF Core and Fluent Api

I can not activate the Auto_Increment of the ContactIdId field in PostGre. In the table mapping I have specified the "ValueGeneratedOnAdd" feature, but when I update the database with Migrations, nothing changes. When I try to insert a record in...
asked by 23.08.2018 / 13:09
0
answers

EF Core - Map dynamic columns to a list

I need help mapping EF Core entities. I have products table and this table may contain different columns depending on customer customization, text columns will always be. I have a table and an entity called Label where it tells me the nam...
asked by 23.08.2018 / 16:12