Questions tagged as 'fluent-api'

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

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

IDENTITY_INSERT is set to OFF - Entity FrameWork Core

I'm working on an application with asp .net-core + entity -framework-core and with mapping and configuration via fluent-api . When I insert into the database I get the error that IDENTITY_INSERT is set to OFF . Follow the Im...
asked by 16.08.2018 / 21:05
2
answers

Code-First Fluent API with complex classes in ASP.NET Core 2.1

Error while performing Add-Migration when using ComplexType classes. public class Cliente : EntityBase { public Cliente() { #region Create HashSet Properties Lists Dependences Titulares = new HashSet<ClienteC...
asked by 15.08.2018 / 19:02
0
answers

Creating FK's with EntityFramework + Fluent-API - ASP.NET MVC

I have some questions about creating FKs with the Fluent API    For example: I have the class Cliente and Endereco , and the client can have more than 1 address, but the address can only belong to 1 client, so I would like to cre...
asked by 19.07.2018 / 15:36
0
answers

How to ignore Entity Mapping Id with Entity Framework?

I have the following class: public class ParametrizacaoTolflux { public int CodigoModulo { get; set; } public int CodigoSistema { get; set; } public string Descricao { get; set; } public int CodigoCategoria { get; set; } } I...
asked by 07.02.2018 / 17:22
1
answer

fluent api - Map table to another table with same key

I need to know how to map in the fluent API the following item public class ImportacaoHeader { public string IdImportacao { get; set; } public DateTime dataInicio { get; set; } } public class ImportacaoLog { public string IdImpor...
asked by 23.01.2018 / 14:39
1
answer

Two foreign keys in the same column EF

I'm having a question, I'm programming with .NET MVC using the Entity Framework. I currently have: class Produto { public int ProdutoId { get; set; } public string Nome { get; set; } public string Descricao { get; set; } publi...
asked by 10.01.2018 / 17:53
1
answer

EF FluentAPI compound key

I'm having trouble defining a compound key relationship in FluentAPI. I have the following entities: Product, Private Person and Stock. I need in the stock table I have a Product FK (ProductID) and a PersonFilial (FilialID) FK so that it is not...
asked by 02.04.2017 / 13:07