Questions tagged as 'entity-framework'

0
answers

I can not resolve the No Persistence provider for EntityManager named

I researched in several forums, made all the suggestions I found and still could not solve. I do not know if it's because of the archetype of the project, but it's the default I'm using. Can someone please help me, I would be very grateful. M...
asked by 11.09.2018 / 21:06
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

Compound key mapping entity framework

Good afternoon, How do I map compound key in my entities, in case the entity calls document and its PK is by property ID and WEBID, and it does FK with the User as I would in that case? Document public class Documento : IAggregate...
asked by 06.09.2018 / 00:48
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
0
answers

Save data from several related classes in the same view - Asp.Net MVC

I have a schedule class where I need to save the client data, the time, and the service that will be scheduled. However, the service is saving correctly through a selection in the DropDownList, but the client data and the Schedule are not saving...
asked by 17.08.2018 / 16:52
1
answer

Where does not work when listing all records - Entity Framework

I need to return all records that contain the informed branch using the where clause, but the Entity Framework is returning all records ignoring what is in where . Where am I going wrong? public IQueryable<PessoaGenerico> Ge...
asked by 19.08.2018 / 22:53
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

Get User Entity ID

I'm trying to get the user id and save it to the table, here's how I referenced it in the ForeignKey table: public string FuncionarioId { get; set; } [ForeignKey("FuncionarioId")] public virtual ApplicationUser ApplicationUser { get; s...
asked by 11.07.2018 / 21:04