Questions tagged as 'entity-framework-6'

1
answer

Why do navigation properties need to be declared as virtual? [duplicate]

I'm mapping a 1 x N relationship using a POCO class to use with the Entity Framework 6 . In this case, I have a Cart entity that has multiple Products : public class Carrinho { //Outras propriedades da classe public virtual...
asked by 15.03.2017 / 13:42
1
answer

Entity Framework 6 - Migrations - Add column with default value and name constraint

I want to add a column of type BIT to an existing table with a default value of 1 via migrations. The challenge is ... we have in the company a default for the name of constraints and it is not legal the name automatically c...
asked by 26.05.2017 / 21:02
1
answer

Update Many To Many Entity Framework

I'm having trouble updating with many to many relationship. I want the update method to update all fields of the itemEntity as well as the providers. For example, I just put the description field and vendors according to the screen image....
asked by 26.05.2017 / 16:19
1
answer

Relationship 1: N using EF using Data Anotation

I am trying to map between these two classes, where in championship I have a list of all steps related to the championship Follow the classes, [Table("ETAPA")] public class Etapa { [Key] public int Id { get; set; } [Column("ETAP...
asked by 21.04.2017 / 20:52
1
answer

Many-to-Many Update with EF 6

My problem is when I try to update an entity that has a child class that in turn has other children. The structure is this: public class Diagrama { [Key] public int Numero_Diagrama { get; set; } public virtual List<Transicao>...
asked by 13.03.2017 / 03:17
1
answer

Error in running update-database migration

I'm trying to run the creation of my database, but I'm getting this error below and I'm not understanding why:    The type 'Client' can not be mapped as defined because it maps inherited properties from types that use entity splitting or anot...
asked by 24.02.2017 / 21:42
1
answer

Many Deletion for Many Entity Framework

I'm having a big problem with a many-to-many deletion in Entity Framework 6. Below is my three classes. Budget class. public class Orcamento { public int Id { get; set; } public int ClienteId { get; set; } publi...
asked by 02.02.2017 / 01:43
1
answer

Map relationships with Fluent API

I have three simple classes of city, state and country. I noticed that simply declaring a property of type Estado in class Cidade the foreign key is generated correctly. I would like to know how to do these mappings in the hand, I...
asked by 05.07.2016 / 15:44
1
answer

Give preference to the results that have the parameter passed in the Entity Framework [duplicate]

I'm trying to implement a data solution that first displays the values that have the passed parameter and then pass the other parameters. Example: In a product table you have the following data: Coca-Cola -> Coca Cola Company Pepsi...
asked by 28.03.2016 / 15:04
1
answer

What are the errors in this code using EF6?

What are the errors or improper practices in this code? static void Main(string[] args) { using (var db = new AccountingSystemContainer()) { var invHeader = db.InvoiceHeaderSet.Create(); var invDetail = db.InvoiceDetail...
asked by 10.09.2015 / 01:16