Questions tagged as 'entity-framework'

1
answer

MVC Create Controller - DbContext has been disposed

I'm using MVC / Entity Framework, the error that is coming up is this: The operation can not be completed because the DbContext has been available Yes the record is created, but I get that error every time I save the record. Before, (yest...
asked by 23.11.2017 / 14:47
1
answer

Error in method Include LinQ: Unable to load type 'System.Data.Entity.DbExtensions'

I have an application of WindowsAplication in C # , it is developed in N-Layers . The method in the data layer to get a table did not give problems: public List<styh_m_005_cultivo> GetAll() { using (var context = new TermometroDb...
asked by 24.03.2017 / 17:40
2
answers

How to convert data type System.Data.Entity.Spatial.DbGeography to C #?

My table in DB named SqlSpatialType is as follows: IDCliente int Nombre Varchar GpsLocation Geography EuclideanaLocation Geometry My form and I want to insert records using EntityFrameworK from C #, The problem I have is how to trans...
asked by 09.11.2016 / 14:15
3
answers

Entity Framework - Code first

When I work with EF code first, precisely when the tables already created have data and I need to create a new field or delete a new field. EF forces me to delete the data I had in the tables in order to add or remove a new field to a table....
asked by 20.12.2016 / 18:57
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

Map ORACLE SP that returns a cursor

Please, I need your help to finish building an architecture. What I want to do is the following: Create the ORACLE SP the CRUD, everything is easy, the main problem I have is that for the select I do something like: CREATE OR REPLACE PROCED...
asked by 16.03.2016 / 22:53
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
1
answer

Use SCOPE_IDENTITY to fetch the ID of an insert

I have a user table where when adding a user I can assign several hotels, which is another insert to a table from many to many. Researching a bit I can use the scope_identity() to be able to do this since it brings me the last reco...
asked by 24.07.2017 / 23:06
3
answers

Sending data to a Web Api

I'm doing a system with Entity Framework and Web Api. It has happened to me that I can only pass an object to the Api, I can not send a string, this why is it? Where do you configure that you only receive one object? and not only that, that the...
asked by 08.05.2017 / 14:49
2
answers

Selection from several tables

I have this query that works well var rest = (from de in se.DeliveryConfiguration join re in se.restaurant on de.Restaurantid equals re.RestaurantID where (de.Position.Distance(geografi)/1000) < de.Distance...
asked by 27.09.2016 / 20:04