Questions tagged as 'entity-framework'

3
answers

Using the Case When Then command with Entity Framework

I have the following structure corresponding to a table in my Database: Cat_Codigo, Cat_Descricao, Cat_Observacao, Cat_Status Where Cat_Status is defined by 0 or 1, where 0 -> Disabled and 1 - > Active. But I do not want to...
asked by 22.02.2017 / 15:40
1
answer

How to do a select from a select using the Entity Framework ado.net

I'm developing a system in ASP.NET MVC that defaults to but I'm in need of a select over another select , and I do not know how to do this with Entity . The SQL code you would like to use is the following: select * from pedidos as...
asked by 06.02.2017 / 20:59
1
answer

How to create a composite index in SQLite via Microsoft.EntityFrameworkCore.SQLite?

I'm trying to create a single compound index, but I do not know how to do this in Microsoft.EntityFrameworkCore.SQLite , I'm used to working only with Doctrine and Hibernate and I'm totally lost. This is my template class:...
asked by 05.01.2017 / 16:00
1
answer

What does each thing do in this method? (Mirror Audit in the Entity Framework)

Well, following this great Gypsy answer , where he implements a Mirror Audit , where the following method is implemented in DbSaveChanges() : //Laço de repetição em ChangeTracker.Entries. Mas o que é ele? foreach (var entidade in Chan...
asked by 21.04.2017 / 18:59
1
answer

Unique authentication for multiple projects using Entity Framework

Currently in my solution I have several ASP.NET web projects, each with the default default authentication code of the MVC entity framework (there are small customizations in entities only). The projects share the same entities and the same data...
asked by 19.04.2017 / 18:19
1
answer

Error logging into applications

Well, the scenario is as follows: I have 2 applications ASP.NET MVC in a same project, which is using a Dominio in common. I'll call MVC1 and MVC2 to get better at the sample. I've installed Identity ,...
asked by 15.12.2016 / 05:06
1
answer

is it possible to see the execution order of the entity?

So, is it possible for me to look at the execution order of Querys that Entity Framework mounts? My problem is that it is trying to make a deletion in the wrong order, even after I make the calls in the order that sql server wor...
asked by 20.12.2016 / 21:50
1
answer

Creation of anonymous vs. "named (?) objects"

I have a class that loga some information in the database I am using it as follows: new StudyLogRepository().Create(new StudyLog() { StudyId = Study.Id, CycleId = null, DateOccurrence = DateTime.Now, CycleActionName = "Nova estud...
asked by 08.05.2017 / 19:06
1
answer

Error in TransactionScope

I'm trying to make a TransactionScope but it always gives me an error:    Application Server Error '/'.       A second operation started on this context before a previous   asynchronous operation completed. Use 'await' to ensure that a...
asked by 08.05.2017 / 06:04
1
answer

Error using Code First From Database

I'm trying to use the Entity Framework with a SQLServer database that I created out of Visual Studio. The problem is that when I add the ADO.NET Entity data model in the project to make the relation, it is failing to create one of the classes to...
asked by 15.10.2017 / 20:49