Questions tagged as 'entity-framework'

3
answers

Return Json from object in C # with Entity Framework

I have a problem with returning a Json using Entity Framework. The code I'm using is: [AcceptVerbs(HttpVerbs.Get)] public JsonResult Item(int agendaHorarioID) { using (var db = new ERPContext()) { IList<AgendaHorario> age...
asked by 20.05.2014 / 13:47
2
answers

Where to call SaveChanges () when you have multiple repositories?

I'm developing an application with Entity Framework, with several repositories. Each repository encapsulates SaveChanges() of DbContext. When a business layer operation uses multiple repositories, and data changes, I need to call...
asked by 13.08.2015 / 13:08
3
answers

How do I search and save a single field?

How can I fetch a single field from the table change it and save this field without having to fetch all fields from the table? The reason for this is simple, I have some tables that have more than 30 columns and this has a high cost of proces...
asked by 22.10.2016 / 23:35
2
answers

How ViewModel works in ASP.NET MVC

I have a situation similar to this question where I need to save multiple models at once and relate each one. I would need to kind of cascade save to first save one entity and then go save the others, because of relationships. Following t...
asked by 27.05.2016 / 03:43
1
answer

Execute insert in Migrations Entity Framework

I'm developing an ASP.NET MVC project with Entity Framework Code First. I've mapped the bank and managed the first Migrations, my question is: can I run a insert shortly after a table is created? Example: CreateTable( "dbo.P...
asked by 06.01.2016 / 23:08
2
answers

How to create a non-repeating sequential number per user

Work on a bill invoice project, in this project there is the Emissor entity. My database Sql-Server may have multiple emitters. Each issuer can issue its invoices. Each invoice must have a unique, sequential number. This seque...
asked by 14.03.2018 / 19:16
1
answer

Many to Many relationship problem in the Entity Framework

I have the following situation: To perform an authentication, I am using the old method for a small application, for assigning levels (roles), as many examples that have the web apart. I use EF and Postgres to access / write data and the Flue...
asked by 26.11.2015 / 17:52
1
answer

Generate new migrations based on all models

I need to create a migrations with all the created models (I just deleted the first migration and I'm not able to create the authentication database).     
asked by 28.09.2018 / 04:17
1
answer

Filtering PostgreSQL information on Windows Forms using Entity Framework

Is there any way to find the information in postgresql by nickname? But without using alias , just in the field record in the table do I already enter the real name for the field? Example:    customer_id will be called "Customer Code"  ...
asked by 17.04.2017 / 22:36
1
answer

How to fix the error Attribute 'name' not recognized in Webconfig?

I'm developing a web project in VS 2012, this application connects to a MySQL database developed in MySQLWorkbench 60 CE with the MySQL 5.6 server, I have referenced in the project the EntityFramework version 6.1, MySql.ConnectorNET.Data 6.8.3.2...
asked by 29.05.2014 / 00:47