Questions tagged as 'entity-framework'

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
0
answers

EF - A member of the type, 'X', does not have a corresponding column in the data reader with the same name

Good, I'm using EntityFramework to pass the result of this query: SELECT a.* FROM [Logística$Sales Invoice Header] AS a INNER JOIN [Logística$Sales Invoice Line] AS b ON a.No_ = b.[Document No_] WHERE 1 = 1 AND b.Type = 2 AND a.[Bill-to Cus...
asked by 01.02.2018 / 11:40
0
answers

Data provider .net framework requested. it may not be installed

I use entity framework 5 in an MVC project. When I was with the 4.0 framework installed on Pc it worked perfectly. Now that I have installed the. Net framework 4.5 SDK and framework 4.6 when running the application the following message appears:...
asked by 25.01.2018 / 21:02
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
0
answers

Which is faster? Search given on the Bank or reading a cookie?

Well, in your opinion, what would be best in this situation? I'm working on an Asp MVC and Entity Framework site. I have a table of federative units where I have (simplifying) 3 columns Id, StateName, StateName. Example: 1, Minas Gerais, Mina...
asked by 13.01.2018 / 18:11
1
answer

How to avoid having to refer to EF?

Hello, everyone. I basically have a data access layer with EF6 and a presentation layer (Asp.Net WebApi). I am not able to make it work without the presentation layer referring to EF. Does anyone know how to solve this? My solution is curr...
asked by 16.01.2018 / 18:51
1
answer

Error with Nuget - Entity Framework

I'm starting with C# and I need a force. I tried to connect to the database, using entity framework . In the visual studio output the following message appeared:    System.TypeLoadException: Could not load type 'NuGet.NuGet...
asked by 23.01.2018 / 01:43
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
0
answers

Entity Framework (Database first) - Include DataAnnotations

I saw in an MS link that it is possible to create a partial and a Metadata class to include DataAnnotations in properties created by the Entity Framework (database first). Well, I did as the example, but the application has an error:    The m...
asked by 28.12.2017 / 14:47
0
answers

A referential integrity constraint violation has occurred

I'm getting this error every time I try to update an object in my SQL database via EntityFramework , the error is as follows:    A referential integrity constraint violation has occurred: Property values that define referential constraints a...
asked by 04.01.2018 / 11:35