Questions tagged as 'entity-framework'

1
answer

Mapping with Entity Framework

Good afternoon, When analyzing a code I see in the mapping the following line: this.HasKey(t => t.IdEstudante); Understand what you do in practice but not theoretically, refers to the object but explicitly what this parameter is sayin...
asked by 03.01.2019 / 19:12
2
answers

Scaffolding ASP.NET giving error

The error is generated using VS 2012. When I try to create the Controller for my News using the Entity framework, I have already tried in several ways. My database you can see on the server explorer on the left. I'm trying to create the contr...
asked by 06.02.2014 / 20:00
1
answer

Entity - Infinite Loop in JSON conversion

What happens I'm having a problem using Entity with my MVC application. What happens is that when converting a class to JSON the program goes into an infinite loop and returns no-content Example Taking as an example the re...
asked by 29.11.2018 / 19:52
0
answers

doubts with linq to entities

What would be the query in linq to entities: SELECT COUNT(cont) qtde_resp , pergunta , resposta FROM pesq_respostas WHERE id_pesquisa = 9 AND Tipo IN ('Intervalo', 'SimNao') GROUP BY pergunta...
asked by 06.12.2018 / 18:45
0
answers

doubts with Entity Framework / SQL

I have the following script: WhenIrunit,Igetthefollowingresponse: ButwhenIruntheEntityFramework,thereturnistotallydifferent,onalllines,theansweristhesame,isitabug?OrdidIdosomethingwrong? follows the template: public class PesquisaDash...
asked by 06.12.2018 / 19:04
1
answer

Create DropDownList with ViewBag

I'm getting the following error:    InvalidOperationException: There is no ViewData item of type 'IEnumerable' that has the 'Office' key. Here I look for the database: public IEnumerable<SelectListItem> GetAllOfficeAsync(Guid user...
asked by 01.11.2018 / 14:43
1
answer

Help with LinQ Method using group by Dynamic

I need to build a dynamic chart from a filter panel and two select fields that can be crossed. I already have the structure that goes to the graph and how I need to return from the backend . In the case of backend I have the code below t...
asked by 14.11.2018 / 20:10
0
answers

Code Based Configuration - EF6

I've been trying to implement a connection to an Oracle 11g database using the EF6 code-based configuration for a few days, but nothing I've done so far seems to work. Currently this is my implementation: App.Config<?xmlversion="1.0"...
asked by 12.09.2018 / 16:56
0
answers

Query on table name by Reflection

I'm trying to make a query in the table, that its name will come by method scope, but it does not allow me to use Select(); or Where(); System.Type referenceTableType = System.Type.GetType("MeuProjeto.Model." + typeRequest.Refer...
asked by 17.09.2018 / 14:27
1
answer

DataBase First approach with Lazy Loading disabled?

I'm going to start a project and the Sql Server database already exists so I'll take the Database First approach as an example of this article Entity Framework Tutorial . Home I will create the .emdx file and import the respective ta...
asked by 29.09.2018 / 23:59