Questions tagged as 'entity-framework'

2
answers

Query by Linq and Lambda getting range of options by sub-query. How to get a result closer to the simple?

Given the following classes: MenuRaiz : public class MenuRaiz { public MenuRaiz() { Menus = new List<Menu>(); } [Key] [DatabaseGenerated(DatabaseGeneratedOption.None)] public int Id { get; set; }...
asked by 22.10.2014 / 14:45
1
answer

Problems with logic to bring data from a list or table

I made several posts here and solved almost every problem. However I understood that the problem was in the logic that I set up to bring the result. I know I'm asking a lot, but I'm trying and I realize there's something missing in me to solve t...
asked by 22.09.2014 / 21:15
1
answer

Contexts unique to authenticated users

Using the method recommended by @Gigano in this response ( Is it possible to leave connectionString dynamically? ), I was able to get a dynamic connection, and using the idea of mapping a context with the user data as the name of the bank, host,...
asked by 01.11.2016 / 19:18
1
answer

How to do authentication in MVC application with linq?

I have a project in ASP.Net MVC and I am putting the authentification manually. Everything is going well, but I used as a reference an already ready project that uses the EntityFramework, but I want to use linq for my operations. The problem is...
asked by 28.05.2015 / 13:53
1
answer

How to know which SQL is generated by the ORM Entity Framework?

With the use of the ORM , and the practice employed we forget that they generate SQLs and return Objetos (vice versa). How can I find out at runtime the SQL generated by the Entity Framework directly in Visual Stud...
asked by 14.06.2014 / 17:48
2
answers

Ignore a specific exception

In my try-catch , I want to write the exception that occurred within an object (for historical purposes, necessary for the business rule, since this section occurs in a processing via integration with external sources). > To do this, I n...
asked by 17.01.2017 / 13:37
1
answer

The ADO.NET provider with invariant name 'MySql.Data.MySqlClient' is either not registered in the machine or application config file

I have a project in MVC, and wanted to connect to the MySql database. I put this connectionStrings . <add name="Contexto" connectionString="server=127.0.0.1;User Id=xxxxxx;password=xxxxx;database=iesb_site" providerName="MySql.Data.My...
asked by 21.02.2017 / 15:31
2
answers

How to perform a Where using Entity Framework

I have a web application that needs to present a list containing some data, for this, I created the Model: Crm_Analise : public class Crm_Analise { [Key] public int id { get; set; } public string cod_item_CRM { get; set; }...
asked by 12.07.2017 / 21:02
1
answer

Is it possible to use composite key for Entity Framework with Model First?

I have the modeling down and I need to map composite keys as the embedded id of hibernate, but in the entity framework using the model first, is it possible?     
asked by 30.10.2015 / 22:48
3
answers

Inheritance in EntityFramework

I have a parent class DadosClientes and two child classes DadosClientesPF , and DadosClientesPJ . The DadosCliente instance has the field: Nome , Telefone The instance DadosClientePF has the fi...
asked by 07.04.2015 / 15:49