Questions tagged as 'entity-framework-core'

1
answer
1
answer

Default value for property according to type and core

I have a code in which I define some properties according to the type of the variable in EF6 protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.Properties().Where(p => p.Name == p.ReflectedType.Name +...
asked by 28.03.2018 / 14:27
1
answer

EF Core Complex Object Insertion with WebAPI

I'm developing a WebAPI (.NET) application with EntityFramework Core. I have implemented the following entities: Pais.cs public class Pais { [Key] public int Id { get; set; } [MaxLength(100), Required] public string Descri...
asked by 29.06.2017 / 15:10
1
answer

How to configure the IncrementBy of a PostGreen Id field using the Entity Framework Core

I have a table mapped to PostGre, but when I update the database, the PersonFisicaEnderecoTipoId Field is being auto-incremented by 10 (by default). How do I map so that IncrementBy is set to autoincrement by 1 in 1? TableMapping:publicclass...
asked by 30.11.2018 / 19:15
1
answer

When the property is not int such as forcing the entity to create a field in the table as nullable: false

The migration is generating the name field in the table as nullable: true I do not want it to be true, how do I solve this problem? public class Professor { public string Id { get; set; } public string Nome { get; set; } public s...
asked by 31.10.2018 / 19:55
1
answer

Error EF Update Method with Firebird 2.5

When I try to update an entity Firebird is returning this error "Implementation limit exceeded block size exceeds implementation restriction", simply get the entity of the bank and has to update without changing anything in it, so I saw the link...
asked by 29.06.2018 / 20:55
1
answer

Entity Core, relationships

In my project I have two models: student and occurrence. In the routine of registering / editing a student, it is quiet, however, in the routine of registering an occurrence, I do not know why, the entity saves nothing of the occurrence, but...
asked by 03.05.2018 / 03:29
1
answer

Write a Json string in the database C #

I'm getting the data correctly, and getting them to separate correctly too, only problem is that I do not know how to use the values and be able to write to the database, could they help me? The image below shows how I'm getting the data and...
asked by 21.11.2018 / 13:53
0
answers

Update data that has many-to-many relationship with Entity Framework

I'm trying to update an object and the only thing that does not update is its relationship from many to many the rest as first and last name update [HttpPost] public IActionResult AtualizarProfessor(int id, string nome, string sobrenom...
asked by 10.11.2018 / 17:58
1
answer

Error When Updating Database with Entity Framework Core Code First

I have my domain created with N objects and these objects are converted to table in the database, in the Framemework Core Entity with Code First. If I create the database with the tables it creates perfectly however if the table already exists a...
asked by 22.11.2018 / 17:13