Questions tagged as 'entity-framework'

2
answers

Update data using LINQ

I've read that LINQ should be used for queries, but in the context below, the best way I found to update was using let . var produtos = from o in orcItens join p in Produtos on o.Id equals p.Id let x = p.Estoque -= o.Quant...
asked by 02.01.2016 / 02:18
1
answer

Find data from related tables

I know that to return the values of a directly related entity in the database is done with LINQ: List<Usuario> lista = banco.Usuario.Include("Tipo").ToList(); But how do I get the data back from another table related to the "Type" tab...
asked by 26.05.2015 / 14:06
1
answer

Problem with relationship Entity Framework

I am having problems in my bank relationship, I am developing an application that manages Courses, I am still a beginner in ASP.NET MVC. I have two Student tables and Course tables, and I have another table that links those two StudentCours...
asked by 12.06.2015 / 06:27
1
answer

Connection Entity Framework with Mysql

I have done the procedures pointed out in these questions: Entity Framework - Bank Compatibility MySQL Connection Error asp.net MVC I installed MySQL.Data.Entities. My web.config looks like this: <connectionStrings>...
asked by 07.11.2014 / 02:54
1
answer

Multiple Bank Login Control

Well, I have my application and every client will have their own database. As each client will have its database, it will also have its user table for login. So I have BancoEmpresa1 - User / Password: [email protected]/123 BancoEmpresa2...
asked by 21.03.2014 / 15:07
1
answer

Unit of Work with repository

In ASP.NET MVC & Entity Framework , because many examples and some open-source projects we find a unit of work together with repository pattern and DbContext is already a unit of work, including projects with IoC and DI...
asked by 20.09.2014 / 23:06
1
answer

Primary key composed with entities in the Entity Framework

I need to make a composite primary key relationship in the entity framework using the entities themselves. public class ProjetoDocumento { public Projeto Projeto { get; set; } public Documento Documento { get; set; } }     
asked by 13.03.2015 / 04:27
1
answer

Exchanging Entity Framework EDMX by Code First

I have an application with EF5 using EDMX modeling and I have much more experience and affinity with Code First. Does anyone have any idea / tutorial on how to migrate from EDMX to Code First without changing the database and entity classes?   ...
asked by 10.03.2015 / 13:42
2
answers

Form in the view with sub-forms in partialView

Dear friends, I have a view that contains only @model Projeto.Models.Oc and a form . Within this form , I have buttons that call MODAL , these MODAL have partialView , @model Projeto.Models.Rc , etc. I wanted to...
asked by 07.04.2014 / 15:12
1
answer

How to declare single-key fields with EntityFramework?

One thing that many are looking for but there is no feature available in versions from EntityFramework to 6 is the use of unique keys ( unique keys ). Including users asking how to create such a control and the incredible is that a...
asked by 09.05.2014 / 23:23