Most voted "entity-framework" questions
ADO.NET Entity Framework is a set of tools for object-relational mapping or Object-Relational Mapping (ORM) for the . NET Framework by Microsoft, Since version 3.5 SP1.
Learn more…1,214 questions
Sort by count of
-
2
votes2
answers704
viewsEntity - Disable Lazy Loading?
I am at the beginning of project development. This project will have a large database. Is it advisable to keep Lazy load enabled? I’m worried it will lead to loss of performance.
-
2
votes1
answer4486
viewsEntity Framework Connection with Mysql
I did the procedures outlined in these questions: Entity Framework - Bank Compatibility Error Mysql Connection Asp.net MVC I installed Mysql.Data.Entities. My web.config looked like this:…
-
2
votes1
answer332
viewsInheritance in Database
I am developing an application, where I have 3 tables that have the same attributes, but as they had attributes in these tables that were mandatory for some, and not for others, I decided to…
-
2
votes1
answer130
viewsSearch with Checkbox
I am trying to create a search system in my application where the user can search the site publications according to gender. I can list the generos registered with checkbox, but I’m lost to do the…
-
2
votes1
answer69
viewsCreate Linq - EF List with n sublists
I have a list with N results, I would need to make some change in the list for this list to return N lists of only 3 underlying results. Any idea?
-
2
votes1
answer107
viewsGet Total Relationship Items 1:N
I have two Product and Items tables - these tables have Father/Son relationship respectively. I would like to know how to get the total of items in the Items table knowing that each customer can own…
-
2
votes2
answers539
viewsContext Dispose should be used in ASP.NET MVC?
In the Web Forms every time I’ve assembled some kind of CRUD, used the using to make an implicit Dispose(). public List<Produtos> Lista () { using (var ctx = new DbContext()) { return ctx.…
-
2
votes1
answer58
viewsError logging data in Viewmodel
Have that question where I did according to the answers, my logic... Only now, when registering the data, an error was generated. This error refers to a view property that cannot be null, which is…
-
2
votes2
answers718
viewsEntity Framework or Stored Procedure
When to use Entity Framework example: var registros = db.Tabela.AsQueryable(); registros = registros.Where(r => (intTipo == 0 || r.IdTipo == intTipo) && r.IdArea == intIdArea &&…
-
2
votes1
answer382
viewsBegintransaction vs Transactionscope
I was analyzing that answer and the doubt arose: What’s the difference between BeginTransaction and the TransactionScope? Are there specific situations for each one? What are their advantages and…
-
2
votes4
answers582
viewsEntity Inner Join in LINQ
I wanted to make an Inner Join so that I get a list of the names of Logins from the Integer List of UsuarioID class LoginsAtivos. public class Login { public int ID { get; set; } [Required] public…
-
2
votes2
answers977
viewsConnection to the database in ASP.NET with Entityframework
I need to migrate a system from one server to another. The system is in ASP.NET and the connection to the database is a little strange. I need to know how to connect to the database. The only thing…
-
2
votes1
answer7457
viewsHow to make a SELECT with Entity Framework?
I’m developing a kind of a C#QUIZ, and I’ve managed to do the INSERT part of the questions and answers in the bank, but I’m having difficulty bringing the question and the answers from the bank to…
-
2
votes1
answer1453
viewsList directories and subdirectories
I have a Treeview component, and a structure in the database that already has in the table directories the subdirectories. has a field called director_parent_guid, if it is null it is because it is…
-
2
votes1
answer78
viewsOrganize EDMX Classes
I have a DB First project that uses an EDMX to map the database. The tables have standard columns that exist in all of them and that I could organize and make the code much more generic if it was…
-
2
votes1
answer70
viewsRemove serial column creation Entityframework + Npgsql
Ola, I am creating an application using Fluent API + Entityframework. But in my domain classes when determining that a property is PK it automatically defines it as serial, I would not like to get…
-
2
votes2
answers1291
viewsWhat is READ_COMMITTED_SNAPSHOT?
What is READ_COMMITTED_SNAPSHOT EF6 Transaction Support About Anyway? What is your use within the Entity Framework?
.net entity-framework entity-framework-6 terminology software-engineeringasked 8 years ago Marco Souza 12,304 -
2
votes1
answer156
viewsNot In Linq Sql Entity Framework
I need to do Nessa research, but presents the error: ambiguous Invocation. public List<Notification> Get(List<UserVisualization> item) { return db.Notifications.Select(o=>…
-
2
votes2
answers1466
viewsEntityframework complaining of Identifier duplicity even with the property being null
I have the following classes: Product: public class Produto { [Key] public int Id { get; set; } [MaxLength(70)] [Required(AllowEmptyStrings = false)] public string Descricao { get; set; }…
-
2
votes1
answer102
viewsCalculated field with RU
I have two classes : public class Cliente { public int Id {get;set; public string Nome { get; set; } public string Email { get; set; } public string Telefone { get; set; } public string Celular {…
-
2
votes3
answers757
viewsError while updating data
I have a base repository where I only perform CRUD. When working with one data at a time, it works normally. However, I needed to make a modification and send several records to be edited at once.…
-
2
votes2
answers2268
viewsWhat is the difference between Tolistasync() and Tolist()?
What difference between ToListAsync() and ToList()? As in the example below, what is the difference between one and the other? using Modelo.Classes.Contexto; using System.Data.Entity; using…
-
2
votes1
answer729
viewsSearch data from related tables
I know that to return the values of a directly related entity in the bank is done so with LINQ: List<Usuario> lista = banco.Usuario.Include("Tipo").ToList(); But how can I get the data from…
-
2
votes1
answer74
viewsAttach many objects with id = 0
Good morning Personal, In my system here at work I have the following architecture: A PROJECT (which has some information) is composed of several PARTS. The parts are very different from each other.…
-
2
votes1
answer92
viewsHow to bar the registration of an already registered user
I am developing an application that manages Courses in Asp.net MVC, I’m still a beginner, and I’m trying to do the following: The Student has a screen where he lists all the courses for him to…
-
2
votes0
answers100
viewsENTITY truncating decimal value when doing SELECT
I have the following situation, When executing a query using LINQ, I get the following return 5178560,00 but if I run the same query, directly in SQL SERVER, it returns me 5179975,00. It’s not a…
-
2
votes1
answer148
viewsDevelopment without EF ORM
It is valid the development without ORM, because today I want to develop an ERP, but I have no knowledge in any framework, is it valid I do everything in hand? I will have the same result? Because I…
-
2
votes1
answer404
viewsProblem with Entity Framework Relationship
I am having problems in the relationship of my bank, I am developing an application that manages Courses, I am still beginner in Asp.net MVC. I have two tables Pupil and Course, and I have another…
-
2
votes1
answer316
viewsUnique authentication for multiple projects using Entity Framework
Currently in my Solution I have several ASP.NET web projects, each with the default authentication code of the Entity framework MVC (there are small customizations in the entities only). Projects…
asp.net-mvc entity-framework login forms-authenticationasked 7 years, 7 months ago Guilherme Ramos 35 -
2
votes1
answer6800
viewsEntity Framework Connection String
I am creating a project using Entity Framework. My question would be, how can I create a connectionString (for SQL Server for example) and set in my Dbcontext where it will get from the Web.config…
-
2
votes1
answer147
viewsMake calculation using LINQ
I am developing a program in c#. In it I have three tables: produto { string idProduto; string descricao; } entrada { string idProduto; int quant; } saida { string idProduto; int quant; } and I want…
-
2
votes2
answers431
viewsWeb system accessed by various companies appsettings
I am developing an application in ASP.NET Core, in which each company has its own database. The question is: how can I do for the company To access the site by putting user and password and access…
-
2
votes1
answer721
viewsEntity Framework associative table mapping
Abstracting some details I have these classes: public class Department: Entitie { public string Description { get; private set; } public DateTime CreateDate { get; private set; } public virtual…
-
2
votes1
answer2950
viewsDropdown List from a table in the Database
I’m developing in Asp.net-mvc and I have the following problem: I need to create a dropdown list that displays the name of the instructors registered in the Database. CRUD is already working…
-
2
votes2
answers594
viewserror GET method while consuming Webapi
I created a project in Aspnet Webapi, added a ADO(Database-first) to connect to the Mysql database and created the controller using the option 'Controller with read/write actions and views, using…
-
2
votes2
answers2201
viewsPerson registration using multiple viewModels and only one controller
I want to register a person, which I have divided into three entities: Person, Contact and Address. And I want it to be just a registration form. My create action in the person controller looks like…
-
2
votes3
answers393
viewsSort children in consultation Linq
I’m having trouble making an ordination in a query where I have to sort the children by the ID, Follow the Source. public Grid GetByOrderGridData(long id) { var query = from c in…
c# asp.net-mvc entity-framework linq lambda-expressionsasked 7 years, 4 months ago Thiago Ubiratan 353 -
2
votes0
answers513
viewsSend a list to a web api using $http.put from Angularjs
I’m having trouble sending a list using the $http.put method from Angularjs, I can send an object normally, plus a list is not following, someone has some example code so that I can take this doubt…
-
2
votes1
answer132
viewsWhy is it not recommended to use the C# project event with WPF and MVVM?
I am too young for WPF I am doing a project using MVVM and Entity Framework and it has been suggested not to have any event Click to a button in the code behind a window, for what reason? What is…
-
2
votes1
answer34
viewsFiltering result by category
using (ObjectContext ctx = new ObjectContext("name=kinectEntities")) { ctx.DefaultContainerName = "kinectEntities"; ObjectSet<produtos> query = ctx.CreateObjectSet<produtos>(); foreach…
-
2
votes2
answers74
viewsCreate a new record based on another with Entity
I need to add some columns to a database as follows: save a comic line to a variable Market novo = new market(); novo = context.Markets.where(blabla).First(); change a row column novo.ParentID = 50;…
-
2
votes1
answer1058
viewsHow do I add more than two conditions to an Expression dynamically?
I need to pass a list of Expressions as a parameter and create the Ands in the most dynamic way possible. Just like that, whenever I add a new Expression on the list, I’m going to have to change the…
-
2
votes3
answers185
viewsUpdate to 2 tables
I cannot update the 2 tables. The problem is here. db.Entry(catequizando).State = EntityState.Modified; db.Entry(pessoa).State = EntityState.Modified; db.SaveChanges(); Some solution? Controller:…
-
2
votes1
answer466
viewsMapping of Associative tables with Entity Framework
I have the following problem: A client has tasks for each day of the week. Example: Client A - Saturday - Wash Car, Clean House... Map it as follows: public class Cliente { [Key] public int Id {…
-
2
votes1
answer208
viewsDoubt in the operation of Automatic Migration with Migratedatabasetolatestversion
With automatic Migration the database is updated also when there is deletion of some property from my model class? That is, in addition to including a new attribute if something is added to my…
-
2
votes1
answer69
viewsHow to split a Datetime-like column from an Entity Framework query?
I own a field of the kind DateTime? (void allowed) which is in the full date/hour formed (dd/MM/yyyy hh:mm:ss). I need to display the date and time in separate columns in a datagridview. I tried to…
-
2
votes2
answers636
viewsError creating ASP.Net Core 2.0 database - Keyword not supported: 'initial Catalog
Hello, I am trying to create a database with SQL Server using the Entity Framework Core, but this presenting the following error: Keyword not supported: 'initial Catalog'. Does anyone know what it…
-
2
votes1
answer189
viewsHow can I make a MVC lambda filter
I’m making a simple filter, and show the data on the page. The code I’m using is this: mt.ModelItens = db.Forecast .Where(f => (f.CanalForecast.area == idArea && f.CanalForecast.despesa…
-
2
votes1
answer108
viewsRequired validating property of another object
I have the following properties, however when I will validate via Modelstate.Isvalid returns that the description of the user group to be informed that it is User too, but the problem is that I am…
-
2
votes1
answer194
viewsEntity Framework Code-First - Automaticmigrationsenabled
I am learning Code-Fist and I came across the following situation: I am using the AutomaticMigrationsEnabled = true for the database to be synchronized with the classes. But the changes I make in…