Questions tagged as 'entity-framework'

1
answer

Execution order of migrations

Hello On my first job, I worked using code-first with the Entity Framework 4. At this time, I saw a limitation on it: the generated migrations only ran in order. For example, if two people are working with persistence in my branch, generated...
asked by 21.03.2016 / 22:40
1
answer

Difference in forms of exclusion with EF

I want to know, what is the difference (if any) in the form of exclusion using EF db.Contexto.Remove(objeto); db.SaveChanges(); And using EntityState.Deleted; Db.Entry(objeto).State = System.Data.Entity.EntityState.Deleted; Db.Save...
asked by 24.05.2017 / 05:08
1
answer

How to call procedure using Asp.net MVC with Entity Framework

In an asp.net mvc application, using ADO.NET with entity framework and mysql , I have a procedure , which returns a listing. CREATE PROCEDURE SP_CATEGORIAS() BEGIN select * from (select a.id, @row...
asked by 07.08.2015 / 17:55
1
answer

Entity Framework - Deleting object with relationship

I have a question for understanding the behavior of Entity. Because when I pass null to a property the Entity should not "clean" the relationship in the bank? My Model: public partial class Ocorrencia { [Key] public int id {...
asked by 29.03.2017 / 19:29
2
answers

Persistence using Fluent API

How do I persist an address without having to pass all client information? Below is my address client mapping: HasMany(f => f.EnderecoList) .WithMany(e => e.ClienteList) .Map(me => {...
asked by 28.09.2015 / 18:13
2
answers

Is it feasible to use more than one DbContext for the same database?

I'm developing a new application in ASP.NET MVC and searching I've seen some examples of applications with more than one context. Let's say my application has several different modules, but all entities have some connection. In this...
asked by 09.03.2015 / 21:07
1
answer

Code First Table Migration - N for N using Fluent API

I have the following classes: [Table("Area_Cursos_Turma")] public class Turma { public int TurmaID { get; set; } public virtual ICollection<Aluno> Alunos { get; set; } } [Table("Area_Cursos_Aluno")] public class Aluno { publ...
asked by 26.09.2014 / 14:06
1
answer

Update one for many Entity Framework

Hello, I need help with an update using entity framework and one-to-many relationship. I think it's pretty basic, but I'm starting with EF and I can not solve the problem. Artist and Telephone Artist entities, where an artist can have several...
asked by 11.01.2016 / 20:58
1
answer

Refresh edmx from the database

I did an update model from database on my edmx. Well, the field I had added to the table appears in the diagram, but in the cs of the non-entity, it continues with the old fields. What do I do, I add in my hand? This is my cs public partial cl...
asked by 06.05.2014 / 19:59
1
answer

C # Union / Order by with LINQ and Performance

Imagine the following situation there are 3 classes Class A, class B, class C, class A has many B classes and many C classes. class B has many C classes. the clsse C has a datetime date field. public class A { DBContext db = new ClassesConte...
asked by 07.05.2014 / 20:01