Questions tagged as 'entity-framework'

1
answer

An object with the same key already exists in the ObjectStateManager. The ObjectStateManager can not track multiple objects with the same key

I have a problem with a bit annoying, I'm trying to do an update using the Entity Framework , but when it arrives in SaveChanges (); the following error appears. An object with the same key already exists in the ObjectStateManager. The Obje...
asked by 13.03.2015 / 20:32
1
answer

Entity framework does not create mdf file

In my ASP.net MVC5 project it creates the default database by Visual Studio 2013. I went to the App_Data folder and deleted the mdf file from the database as well as the log file. I'm wanting it to re-create this file. In my configurati...
asked by 27.05.2014 / 18:39
2
answers

Validation model always fails

I have the following templates: public class Local { [Key] public int Id { get; set; } public virtual Grupo Grupo { get; set; } } public class Grupo { [Key] public int Id { get; set; } [Required] public int? Loc...
asked by 11.09.2014 / 20:23
1
answer

Problem in the size of the FK name

I have a WebApi to work with a database of Firebird 2.5 , I used at the time the EF, but today it is presenting me with the following error    "The name 'FK_ARRUMACAO_CHECKLIST_ARRUMACAO_ARRUMACAO_ID' is longer   than Firebird's...
asked by 21.09.2018 / 20:33
1
answer

Relationship 1x1 (or not)

I have 2 entities: Product Order and Product ... Using the fluent API as I say to my entity Requested Item that it has a Product? Note: The product entity can not have dependencies, although 1 product can be in several items. I do not w...
asked by 07.08.2018 / 17:41
1
answer

How do I not map a Class with the Entity Framework

I'm doing my first system (C # ASP MVC 5) with the Entity Framework and Migrations. I have my classes that have been correctly mapped and migrated to the Database that is SQL Server 2012. But the question is how can I create a class that i...
asked by 18.06.2018 / 14:49
1
answer

Asp Net Core MVC - Create Multiple Form

It's the first time I ask a question, and I'm getting used to the page, so forgive me if I make a mistake. I'm new to Asp Net Core MVC and I'm getting a lot to understand some things. The one that is preventing me from continuing my work the...
asked by 06.07.2018 / 00:10
1
answer

Select with entity framework in N: M with multiple objects

I have the following classes: Client, Contact, Phone, Campaign, and Customer Campaign. Where CampaignCustomer, has a campaign, has a Client (who has a phone list and a contact list and who may have a phone list). I can give a Select in the...
asked by 10.02.2018 / 01:52
1
answer

Select all items with the same ID in the same table

Very well, I'll try to be as clear as possible. I have the stock table where you will have several products there - > ProductId and its Quantity. In the same table the productId can be repeated with a different quantity, in my current code I...
asked by 17.02.2018 / 00:52
2
answers

What is READ_COMMITTED_SNAPSHOT?

What is READ_COMMITTED_SNAPSHOT transaction support for EF6 About Anyway? What is your use within the Entity Framework?     
asked by 04.11.2016 / 13:16