Questions tagged as 'entity-framework-6'

1
answer

When should I use async / await and when not?

I am working with the Entity Framework with ASP MVC and I have the following question, should I always use asynchronous methods? or what should I use to choose between one and the other? Asynchronous private static async Task AddStudent()...
asked by 09.10.2018 / 16:09
3
answers

Transform query result to an entity in an array

In my program I have an ADO.NET Entity Data Model with a couple of tables linked to my database. What I want is to make a query to bring me the data of a table and be able to access them as if it were an array. If for example in the entity ther...
asked by 18.08.2017 / 13:59
2
answers

Validating nulls with linq

I have the following query in linq using (var context = new BusinessContext()) { var result = (from m in context.MovimientoCajas where DbFunctions.TruncateTime(m.Fecha) == DbFunctions.TruncateTime(fecha)...
asked by 19.12.2018 / 14:37
2
answers

Send to a View the list of Customers in my database

I tell you that I'm doing a database where I register clients. And for the disabling of a client I use logical deletion, setting the property of Enabled = false to the client. Then, it occurred to me, that when I loaded my Create.html view, I...
asked by 01.11.2018 / 04:53
1
answer

declare list list as object attribute c #

I have the following object: namespace MODELO{ [Table("Check_lists_PVR")] public class Check_lists_PVR{ [Key] private Int64 NroCL { get; set; } public DateTime Fecha { get; set; } public string Turno { g...
asked by 04.07.2018 / 01:29
2
answers

entity framework code first how to use it with an existing database

Good, I have a database that was not created with Entity Framework code first. It has tables and independent data, then, create another independent web project in which if I use EF. It is possible to use the BD that already exists to put the EF...
asked by 27.09.2017 / 16:32
2
answers

Using DropDownList to display data from a database

I have a form made with MVC and Entity Framework. What I want to do is that using a DropDownList that brings the descriptions of the ratings. The data is obtained from a database, can you give me a hand? In the controller on line lP...
asked by 19.06.2017 / 00:12
1
answer

The content of DropDownList with Entity framework can not be saved in a bd

I am using the Entity framework for data persistence, I want to save an id (the field is of type identity), a name and the gender of the person, but when I click on save, it throws an exception to me Error de servidor en la aplicación '/'. Val...
asked by 09.06.2017 / 05:50
1
answer

How to call a Store Procedure that returns a list of data in the Entity Framework Code First?

I need to show a list in a DataGridView but due to the complexity of the SQL query I prefer not to use Lin-Q so I create a stored procedure but since I use the Entity Framework I do not want to call using SQLConnection but from DbContext.     
asked by 09.01.2017 / 02:12
2
answers

Update Entity Framework 6 Objects disconnected Entities 1: N (One to many)

I'm making an application and I use Entity Framework 6 to access SQL Server. I have the following case, where I want to update the value of two entities: Socio - > SocioDireccion A partner can have many addresses. Firs...
asked by 23.11.2016 / 10:38