Questions tagged as 'entity-framework-6'

1
answer

Working with view in a context in Entity Framework 6

Speak Personal All right !? I have a problem that I would like to be helped. Well I have a simple application with 4 related tables I'musingtheentityframework6,myproblemisintheUSERSclass,becauseinrealityitisaVIEW,fromanotherdatabase,resea...
asked by 10.11.2016 / 21:07
1
answer

Annotation to create Index Unique that accepts null with EF Code First

I want to create the following Index in a table by annotation: CREATE UNIQUE NONCLUSTERED INDEX idx_yourcolumn_notnull ON YourTable(yourcolumn) WHERE yourcolumn IS NOT NULL; SQL source above . The maximum you can do is create an index u...
asked by 11.08.2016 / 15:20
2
answers

Entity Framework: Object Refresh Error

I can not update my object. I created the method as follows: public void Atualizar(T obj) { banco.Entry(obj).State = EntityState.Modified; banco.SaveChanges(); } The following exception was thrown: Attaching an entity of type 'Pr...
asked by 15.07.2016 / 17:01
2
answers

Action Edit in ViewModel

Well, I'm trying to implement the action of editing the data of a viewmodel I have in my project. I even created an action, but it is not working ... What happens is that from what I researched, when you are going to build an edit action, you...
asked by 08.06.2016 / 05:38
1
answer

Error when using EF6 CodeFirst with Mysql

I have the following error when I run Migrations: HowcanIsolveit?Ihaveeverythingproperlyinstalled.Here'smyWeb.Config:<connectionStrings><addname="ProjetoCultContext" providerName="MySql.Data.MySqlClient" connectionString="server=l...
asked by 11.04.2016 / 22:36
2
answers

Context trying to delete 2 times the same record

I'm having a problem, in fact it should be the lack of knowledge even at the time of deleting a record using Entity Framework 6. When I try to delete a record that can not be deleted because it has references, it gives the following error:...
asked by 15.12.2015 / 17:13
2
answers

Add new Controller

When I add a new Controller to my project using the MVC 5 Controller with views, using Entity Framework option I'm having the error there was an error running the selected code generator , depending on the image.     
asked by 09.01.2015 / 18:50
1
answer

Display foreign key attribute error

I have my classes: public class Bandeira { public int BandeiraID { get; set; } public string Nome { get; set; } public virtual ICollection<Curso> Cursos { get; set; } } public class Curso { public int CursoID { get; set;...
asked by 11.09.2014 / 21:31
1
answer

Create record pattern with C # UI repository

I created a repository with EF6 on my system, every record that I have access to the methods of my repository to commit the actions I need (Insert, Delete etc ...). The problem is that my system is very large and I need to gain agility when crea...
asked by 15.07.2014 / 18:07
1
answer

Update edmx file is not working

Whenever I do: UPDATE MODEL FROM DATABASE on top of my edmx file, it does everything right, including showing the table to be updated or the fields. He makes no mistake, he proceeds as if everything is fine. But when I conclude, it does not chan...
asked by 26.05.2014 / 03:13