Questions tagged as 'entity-framework'

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
1
answer

Errors when inserting records using EF

I have this method that receives a list of type VentasLinias and inserts each record in the database public void InsertLines(int idVenta , List<VentasLinias> listVentas) { foreach (VentasLinias vl in listVentas) {...
asked by 24.05.2017 / 17:31
4
answers

How to call a stored procedure from the Entity Framework 6 code first

I'm trying to call this stored procedure from C # alter PROCEDURE GetLecturasEnRangoDeFechas -- Add the parameters for the stored procedure here @fecha as smalldatetime, @idParteMaquina int, @inicio int, @inicioMasDuracion int, @dia smalldatet...
asked by 11.01.2016 / 17:44
3
answers

Get type of an entity framework property

Good morning, You would need to obtain, at run time, the corresponding property data type: foreach(string unaPropiedad in listColumnNames) { clsEntidad.getype().getproperty(unaPropiedad); PropertyInfo prop= prop.propertyType; Type...
asked by 23.08.2016 / 17:51
1
answer

Jquery Ajax Post (onchange infinite loop)

Good people I have the following problem: I have a dropdownList that depending on its value brings me by ajax a different form with its respective button, until there works well. <div id="contformularios1"> </di...
asked by 27.01.2016 / 15:49
1
answer

How to optimize EntityFramework 6 [closed]

Someone can help me how to optimize Entity Framework , by which it takes several seconds to load the EDMX (Conceptual model, Store Model, Mapping Model).     
asked by 06.12.2015 / 19:51
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
3
answers

Remove relationships in select LINQ

My question is the next one, when executing this sentence in LINQ, it brings me the user that I require, but also all the table relations where it has been referenced by a foreign key in the DB, that is, if this user made 1000 sales are going to...
asked by 19.03.2018 / 15:19
3
answers

Call a stored procedure from the Entity Framework

I'm using stored procedure, SQL Server, EF (code first). I have a stored procedure created in the database and I want to call it from my code. Stored procedure: CREATE PROCEDURE uspCreateLocal -- Add the parameters for the stored procedure...
asked by 07.01.2017 / 18:41
1
answer

Scaffolding with Asp.net 5

I have been working recently with asp.net 5, in addition to the new features it has and the improvements it makes I can not find the way to do scaffolding as it was done in asp.net 4. Is there a functional and stable add-on for an asp.net 5 p...
asked by 02.12.2015 / 16:57