Questions tagged as 'entity-framework-6'

1
answer

Add columns with linq

I need to add several columns and return them in a list. But in two columns I will add adding a condition. SQL SELECT SUM(MontoInicial)AS MontoInicial, SUM(CASE WHEN TipoMovimiento = 1 THEN Ingreso END) AS Ingreso, SUM(CASE WHEN TipoMovim...
asked by 19.12.2018 / 23:28
1
answer

Where to place the Data Annotations?

Just in case there is a problem with concepts, I define: Model: = The class that establishes the Tables of the database. ViewModel: = The class I use to send to the Views (so as not to pass the complete Model). My question is this: T...
asked by 15.11.2018 / 22:41
1
answer

Unable to convert type 'System.Int32' to type 'System.Object'

I am working with Entity Framework with mvc and on the client side I have implemented a Select2 for this I have created the following model: public class Select2 { public int id { get; set; } public string text { get; set; } public...
asked by 26.12.2018 / 17:15
1
answer

Can I do Global Query Filters in Entity Framework 6? in the OnModelCreating?

I'm trying to do this in EF6. It can? I wanted to make a blobal filter protected override void OnModelCreating(DbModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); modelBuilder.Entity<Cotizacion>().HasQueryFilt...
asked by 15.12.2018 / 02:13
1
answer

Data is lost in the Controller - View - Controller process

I told you that I have 2 controllers, one for the GET and another for the POST that I am going to edit so that it is easier to understand: // GET: Compras/Create public ActionResult Create(int id) { ComprasCreateModel compra = new...
asked by 25.11.2018 / 07:20
1
answer

Error Intentun Savechanges () Entity Framework 6 ASP.Net MVC5?

When I update my gender object, it brings the date of creation with the following data, which should not because it has a value assigned in the database, I get the following date: The error that shows me when I try to do the savechan...
asked by 31.12.2018 / 14:57
1
answer

when executing the index generates this error

when executing the index it generates this error I am working with entity framework 6 my web.config <basicHttpBinding> <binding name="bsBinding" maxBufferPoolSize="214748647" maxBufferSize="214748647" maxReceivedMessageSi...
asked by 12.09.2017 / 00:02
1
answer

System.InvalidOperationException: An entity object can not be referenced by multiple instances of IEntityChangeTracker

I'm doing a project on asp.net, web form, and I need help with this: System.InvalidOperationException:An entity object cannot be referenced by multiple instances of IEntityChangeTracker. This exception occurs when I try to add an element t...
asked by 14.08.2017 / 16:45
1
answer

Unable to find link string Entity Framework

I miss an error using entity framework and I can not find it. The project I am doing is divided into 3 MVC layers, which in the data layer I have the model of the database and the connection and in the business all methods; but when I want to br...
asked by 18.08.2017 / 14:04
2
answers

Linq query does not respond after updating Stored Procedure in EntityFramework

I'm working with EntityFramework 6 , I have my model created (First DataBase) for quite some time. In my project I have some queries with LINQ and others (to optimize times) made with Stored Procedures (SP). It worked correctly until I n...
asked by 20.04.2017 / 17:22