Questions tagged as 'entity-framework'

1
answer

Doubt about performance in using the using statement

Which of the two ways to check if a record of such TYPE has already been registered is more performative? Are there differences, mistakes? What are the implications? Does using block only release connection resources or all objects create...
asked by 04.06.2014 / 17:40
1
answer

Doubts about using .dbml files

I got a system in aspx (VS2008) and I have to make some improvements, add other features and all this using MVC5. Well, there's a web service, which has a guy like that: static Func<lqDataDataContext, T_PDV, IQueryable<T_PDV>>...
asked by 25.04.2014 / 16:15
1
answer

Attribute without repeating (unique) with Entity Framework?

I'm creating a template with two attributes that can not be repeated, a GUID and a string . To make string ( not the primary key - primary key is GUID ) a unique field should I use HasIndex(x => x.Atri...
asked by 22.03.2018 / 03:15
1
answer

Show fields of an entity in a different View

I have a Academic entity that has a Teacher , I want the Academic Detail Professor who belongs to this Academician . The code I'm already using is this: Teacher model: public class Professor : RepositorioBase<Professor> {...
asked by 08.11.2017 / 17:27
1
answer

Alternative to TransactionScope

I'm using Entity Framework (version 4.4) in an AspNet MVC project with .NET Framework strong> SQL Server . I do not have access to the server where the application is hosted, and from time to time it undergoes some migrations to other se...
asked by 12.09.2016 / 16:28
1
answer

Iterations within TransactionScope

I have an Asp.Net MVC project with Entity Framework 5.0 in .Net Framework 4.0. What are the losses brought by a very long TransactionScope ? I have the following code snippet: using(TransactionScope scope = new TransactionScope())...
asked by 08.06.2016 / 20:55
1
answer

Complex Update Entity Framework

Good morning, I have already asked a similar question, I am trying to complement this view with more information and starting with the most basic. I have the following structure: public class Artista { public Artista()...
asked by 11.02.2016 / 15:37
1
answer

DbEntityEntry.State vs DbPropertyEntry.IsModified

I have a question about these two ways of specifying whether an entity has been modified. I usually use DbEntityEntry.State with EntityState.Modified when I make a very big change in the model and I want all of them to be per...
asked by 14.02.2016 / 21:54
2
answers

Inserting Single Quotes Null Field

I created a very simple application to simulate a small register of clients, but when testing the data manipulation by the application I could see in the database that the fields that are null in the register are inserted into the database with...
asked by 28.04.2016 / 23:04
1
answer

Entity Framework Migration - Indicate migrations as performed

I'm working on an ASP.NET MVC system with Entity Framework, which uses Migrations. It has the following initializer: public void InitializeDatabase(Contexto context) { if (!context.Database.Exists()) { context.Database.Cre...
asked by 14.12.2015 / 20:00