Questions tagged as 'entity-framework-6'

1
answer

What is the purpose of the OnModelCreating method and how does it work?

I'm studying Fluent API and I'm having this doubt, I saw that this method can be empty with no implementation. So how useful is it and how does the OnModelCreating method work in the context class that belongs to the DbContex class?     
asked by 14.09.2015 / 17:43
1
answer

MVC 5 and EF 6 Put another form's view

Continue giving comment error null in this line: ViewBag.PostId = new SelectList(db.Posts, "PostId", "Titulo", comentario.PostId); Probably why you did not enter ModelState.IsValid . I'm doing a project there from college. My pro...
asked by 18.05.2014 / 16:18
1
answer

Customize Asp.net Identity - Multiple classes like User in Identity

We know that our user in asp.net identity is the class with name of ApplicationUser I would like to create other classes that inherit from it Because? Why, let's say I have the Client, Vendor, User class. I want them all to be users of...
asked by 22.05.2014 / 00:00
1
answer

EF6 EntityValidationErrors error in filled property

I am having a similar problem in two ASP.NET applications with Entity Framework. When I try to update an entity that already has all the required mandatory attributes I get a EntityValidationErrors exception, however this property that...
asked by 14.05.2015 / 19:13
1
answer

How to identify the Entity that throws the error when saving?

In my application, with Entity Framework, I make a query in an Entity Framework: var lista = contexto.Rodada.Where(condições); Then iterate over this list with a foreach. During the iteration there are "updates" and "inserts" of several...
asked by 17.03.2017 / 22:21
1
answer

Property of a class that belongs to another context in the Entity Framework

I have a class called Locker that has the following property: public virtual ICollection<LockerReserve> Reserves { get; set; } The problem is that LockerReserve belongs to a context other than Locker. An exception is thrown whenever I...
asked by 30.11.2015 / 13:29
1
answer

Exception when generating Controller with Entity Framework

In my application using Asp.net mvc , with Entity Framework 6 , with Mysql , when trying to add the Controllers , Views , using EF , I get the following error: Myweb.configSettings:<connectionStrings><addname="MyEntities" conne...
asked by 08.08.2015 / 21:59
1
answer

Auditing with Entity Framework

I want to do the audit tables for my entities. At first I thought about overwriting the SaveChanges method. I also thought about writing a method that will be doing the audit on my% base%. Using both ways, I will have a single auditing ta...
asked by 13.10.2014 / 18:22
1
answer

EntityFramework 6 - Load Model and its Dependencies on Home

I have a college project in which I decided to do a blog . Something very simple, author, post and comments. only these three. Well First I wanted the home of the project to load the Blog Posts . I got it. Now I want below each post to giv...
asked by 15.05.2014 / 20:32
1
answer

Is it a problem with my architecture?

I've been a software developer for a long time, but I'm always looking to learn "different ways of doing things". I am currently working on a new project and decided to base the architecture on proposals suggested by the community using a combin...
asked by 04.01.2017 / 18:08