Questions tagged as 'entity-framework-6'

3
answers

How to test performance Entity Framework?

I want to create mapping with inheritance Person - > Customers, etc. But I would like to test performance with the 3 types of mapping (TPH, TPT, TPC) How do I? Anyone had experience to talk which of the 3 becomes easier and faster?    ...
asked by 14.08.2014 / 15:32
1
answer

Field calculated with EF

I have two classes: public class Cliente { public int Id {get;set; public string Nome { get; set; } public string Email { get; set; } public string Telefone { get; set; } public string Celular { get; set; }...
asked by 29.11.2016 / 19:24
1
answer

Doubt in the Declaration of Type of Object - Entity Framework

I need help defining the correct class declaration Follow my code: public void BuscaOcorremcias() { //Op 01 - Declarando um IList da Model IList<Ocorrencia> ocorrencias = null; //Op 02 - Declarando um DbSet System.Data...
asked by 24.03.2017 / 20:18
1
answer

Remote validation preventing data editing

I am using remote validation to prevent repeated emails in the database, which works fine when I do some registration. The problem is that the remote does not accept the original registry value, and does not allow me to save the changes made to...
asked by 06.01.2015 / 01:52
2
answers

Query Entity Framework with Inner Join and Where

I am making a query using inner join of some tables and a where with only one condition, but the data is not returned in EF, the same query in Mysql works and returns data. Follow the code: string raAluno = acr.getAlunoLogado().ToString();...
asked by 21.05.2016 / 05:45
2
answers

Query with related data in the Entity Framework

I'm trying to get data from the materials with the data of your relationships with the tables Unit and TD, but this code below does not return anything, if I do without Include () it returns the data but with the relationship does not bring any...
asked by 20.08.2014 / 16:33
1
answer

SumAsync return zero

I have a query in LINQ where I use SumAsync , however when my entity is empty I have the exception:    The cast to value type 'System.Decimal' failed because the   materialized value is null. Either the result type's generic para...
asked by 08.01.2018 / 14:53
2
answers

Doubt between using compound primary key or not in associative table

I'm making a relationship where it's N: N ... Example:    Project x Employee In this relationship I create an associative table called Projeto_Funcionario taking the id of the two classes.    Project (id, name)       Officia...
asked by 19.02.2018 / 17:24
2
answers

Entity Framework 6: Error in Provider

I'm using EF6 Code First. When performing the "Update-Database" the bank is created normally. But entering the data throws the following error:    No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.Sq...
asked by 29.11.2016 / 15:28
1
answer

Error: Object reference not set to an instance of an object

I'm having the following error:    Object reference not set to an instance of an object Can anyone identify the error in my code? Follow my classes : Program : class Program { static void Main(string[] args) { u...
asked by 08.09.2015 / 22:54