Questions tagged as 'entity-framework'

1
answer

Doubt about mapping in the Entity Framework 6. Properties "readonly"

I have three tables in my bank: TB_COLABORATOR TB_JORNADA TB_JORNADA_COLABORADOR TB_JORNADA_COLABORADOR associates employees with the day and vice versa through the COD_JORNADA and COD_COLABORADOR fields. It also...
asked by 15.06.2015 / 15:33
2
answers

Entity Framework is saving duplicate values when saving entities with relationship N to N

I have an entity called Book that has among other attributes a list of categories. In my model a book can have multiple categories and vice versa, so we have a N relationship for N. The EF therefore creates the books table, the category table an...
asked by 12.02.2014 / 22:21
2
answers

Entity Framework with Oracle databases

I'm creating an application that will use an Oracle database, but when I enter .edmx (Entity Data Model) I came across the following situation! I can not create a connection with Oracle Database. What do I need to do to make this work?...
asked by 10.04.2014 / 15:38
2
answers

Entity Framework Core x Entity Framework 7

What are the main differences between Entity Framework Core and Entity Framework 7? There are scenarios in which one is more indicated than the other. It's such a version and so much change of name that I'm lost.     
asked by 14.09.2016 / 05:22
2
answers

C # MVC Asp .NET Paging

I have a performance problem in paging with Entity Framework and SQL SERVER, first it does getAll to later list paging var bdPergunta = new PerguntaRepositorioEF(contexto); var pergunta = bdPergunta.GetAll().OrderByDescending(x => x....
asked by 29.07.2015 / 15:41
2
answers

Where to put Data Annotation? View Model or Model?

Using Entity Framework Code First, with view model and model . To create a column with varchar(2) , I need to put MaxLength(2) in model and view model ?     
asked by 28.08.2015 / 21:32
1
answer

Return Code object as inserted

I need to make an insert in the Entity Framework and at the same time it returns the code of the inserted object, thus preventing further access to the bank.     
asked by 06.09.2014 / 20:45
2
answers

Lazy Loading EF Core, load daughter entities and subfiles?

I have a Web Api that I am developing using DotNet Core and EF Cor but it has Lazy Loading active, but in some cases I need to load daughters entities and daughters of daughters , I created a generic repository to...
asked by 27.02.2018 / 14:13
2
answers

How to get all records of a mixed table generated by class inheritance when using EntityFramework 6?

I have a class structure in the following form: public class Pessoa { public int Id {get; set;} public string Nome {get; set;} } public class Membro : Pessoa { public int CargoId {get; set;} public Cargo Cargo {get; set;} } p...
asked by 21.04.2014 / 17:12
1
answer

How to automatically fill fields when saving object to bank

I have a system, in ASP.NET MVC that implements an audit form, that when a user inserts or updates an object in the database, some information is saved in an audit table automatically. The interface, which I want to implement is: pub...
asked by 02.12.2016 / 00:54