Questions tagged as 'entity-framework-6'

1
answer

How to insert records in different tables with EF core in asp.net core2?

I have three tables, one of users that relates one to many with a table, and that one is related to the table phone_type, my calendar table has the id_agenda, user_id, phone_type_id, phone. When I create my model I only have the properties of my...
asked by 31.01.2018 / 23:21
2
answers

Error updating EF entity

Friends, the scenario is this: when I want to edit a record in my BD, I'm using context.Entry(entidad).State = EntityState.Modified; ; the problem arises that when you get to this line, you throw this exception to me    Attaching an ent...
asked by 03.10.2018 / 18:22
1
answer

Why do I return iQueryable instead of an instance of my class?

I'm getting the following error when returning an object when validating the login:    You can not implicitly convert the type 'System.Linq.IQueryable' 'to' Business.clsUser.ValidSessionU '. An explicit conversion already exists (check if a c...
asked by 14.09.2018 / 15:07
2
answers

MySql Entity Framework Code-Firsrt

I am trying to persist against a MySql database using the Entity Framework the Code-First approach, use in EF6 I do not get an error, The problem is that I do not create the database or the table or add the records I persist. We show our im...
asked by 10.07.2017 / 01:12
1
answer

Entity Framework returns Null

Good I have this store @CodRegistro NVARCHAR(20) = NULL, @UsuarioWindows NVARCHAR(11) = NULL, @CodPersonal CHAR(5) = NULL, @IP NVARCHAR(11) = NULL, @TipoMetodo INT, @Query NVARCHAR(50) = NULL, @Pagina INT...
asked by 28.03.2017 / 18:04
1
answer

Async crashes when asking entity framework query

I have an aspx project in the use of the repository, generic, and I am starting to use the async methods that the entity framework offers to interact with the database, when trying to save a record, it always hangs up and does not advance the co...
asked by 18.05.2016 / 02:27
2
answers

Transaction Management in the Entity Framework

I'm working with Entity Framework 6 approach code-first, is it necessary to use transaction when registering header and detail, when using EF6? public void InsertOrUpdate(Compra entity) { using (var context = new PosContext())...
asked by 24.08.2016 / 01:21
2
answers

Linq adds a nonexistent column to the SQL query

I'm having a problem with LINQ, using EntityFramework 6 First, to enter the context, I leave the Problem Model .. [Table("Datos_Garantizados")] public partial class Datos_Garantizados { [Key] public long Version { get; set; } public decima...
asked by 28.03.2018 / 16:18
1
answer

How can the asNoTracking () extension be used in context?

I am doing several movements at the same time, and I try to achieve that if one screen I make an exit, in the other being open I check the existence of data, so I am using the extension of Linq "asNoTracking" to be able to consult the correct da...
asked by 12.09.2016 / 17:27
1
answer

Update partial fields with Entity Framework

I am managing a project with MVC and EF 6.2 , in my model I have an entity that has four fields: public class Entidad { public string campo1 {get; set;} public string campo2 {get; set;} public string campo3 {get; set;} pub...
asked by 07.05.2018 / 02:11