Questions tagged as 'entity-framework'

2
answers

Only parameterless constructors and initializers are supported in LINQ to Entities - Asp.Net MVC

I'm developing an application that manages courses. The student, when entering the inscription screen and clicking on the "enrollment" button, is associated to a course, that is, is enrolled. So far so good, only when I try to check if he is alr...
asked by 06.06.2015 / 18:17
1
answer

Database changes with ASP.NET MVC 5

I'm starting some independent projects using ASP.NET MVC 5 with Entity Framework, and more learning from technology. And at the moment I had a great doubt. I used the generated code through a connection to the database, creating an ADO.NET En...
asked by 02.09.2014 / 03:12
1
answer

Complex type can have Entity Type property?

I have an Address class that is Complex Type . Can it have a state property that is an Entity Type ? Class Code: public class Endereco { ... public string Logradouro { get; set; } public Estado Estado { get; set; } } public cl...
asked by 06.01.2016 / 18:59
1
answer

Entity with multiple members of the same type in the Entity Framework

When we have two many-to-many related entities and create the navigation properties correctly, the entity creates an extra table to set up this relationship. In the case where I'm working I have a structure that in the best of worlds would lo...
asked by 18.12.2015 / 08:25
1
answer

Simulate the same SQL in the Entity Framework with Linq and Lambda?

Having this data model I want to generate a SQL in the Entity Framework with < a href="http://msdn.microsoft.com/en-us/library/bb425822.aspx"> Linq and
asked by 03.07.2014 / 17:41
4
answers

How do I update my data in the table using EntityFramework?

var contactado = ContactadoRepositorio.ObterListaContactadoPorCodigo(procedimentoVM.CodContactadoPessoa); //obtenho o contactado pelo id obtido; foreach (var c in contactado) { var contactadoPessoa = new ContactadoPessoa() {...
asked by 21.01.2015 / 13:35
1
answer

Consume repository of entities directly from the application layer

I have a scenario that I need to fetch a list of Active Employees with Entity Framework and display them on the screen (I need to convert to DTOs before displaying - which I do by the Application layer). For a Domain-Driven Design (DDD) scena...
asked by 13.02.2017 / 00:57
1
answer

EF6 - Rush load bringing less aggregated data than bank data

I'm having the following problem with my relationships in Entity. When I look for example a Bank Client by Id: return _databaseContext.Clientes .Include(x => x.Enderecos) .Includ...
asked by 11.05.2017 / 19:12
1
answer

How to List Users with Asp.Net MVC 5

I'm using Visual Studio 2013, I'm creating a new Asp.NET Web Application project using MVC and "Individual User Account" authentication. I would like to know how to list all registered users. Models: IdentityModel using Microsoft....
asked by 25.03.2014 / 15:01
2
answers

Deletion of related data - Entity Framework and C #

Hello, Using the same structure I've been presenting here for some time now, I've come to you for help now to delete the related data. Follow the entities .. public class Artista { public int ArtistaId { get; set; } public string No...
asked by 13.02.2016 / 16:06