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
-
0
votes0
answers277
viewsForeign key Entity framework 6
Someone can help me make a connection between these two tables, I want to use the enrollment field to make that call, and enrollment in the student table is not the primary key. public class Aluno {…
-
0
votes1
answer315
viewsUsing an existing database
I have a database (SQL-Server); if I connect to it, I still have to create the classes EPH and use a Migration?
-
0
votes1
answer192
viewsHow to use Enum with Entityframework
I have a relationship in my system where one class has a relationship with another, but this other class is nowhere in the system to change/delete its state (are only static data). I wonder if the…
-
0
votes0
answers442
viewsError the best Overload for '.ctor' does not have a Parameter named 'throwifv1schema' with Entity
I have an error that is not making me not able to compile the project. I am using Asp.net c# Entity framework code first Error indicates the best overload for '.ctor' does not have a parameter named…
-
0
votes3
answers87
viewsASP.net MVC error
I have this code, working perfectly as I wish @using (Html.BeginForm()) { @Html.AntiForgeryToken() <div class="container"> <form class="well form-horizontal">…
-
0
votes0
answers62
viewsProblems with Objectstatemanager when updating a Model
I’m having trouble updating a model, the code below is working correctly when I give GET in a context model edits on the screen (View) and I give a Submit everything ok but when I have a data grid…
-
0
votes1
answer47
viewsattribute passing empty in Entity
I am trying to do an update only that the fields of Issue Date and Due Date do not have the slightest idea why, is passing null when I call the save changes button. Inside the controller comes a…
-
0
votes1
answer161
viewsHow to view data from various tables in Datagridview?
I’m trying to display several tables on DataGridView, from a database that is Entity Framework. Example, person table, address. I tried to use pessoa.BindingSource, then comes the address list, but…
-
0
votes2
answers110
viewstransform sql with subquery into query in Entity
I’m in need and I’m having trouble getting this sql with subquery and doing the same thing in c# Entity. SELECT Id,Nome, (SELECT Count(Id) FROM Pedidos WHERE Pedidos.ColaboradorId = Colaborador.Id)…
-
0
votes1
answer27
viewserror in running c#Asp.net Entity application
Good morning, My project started from nothing to present this mistake. Could not load file or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of…
-
0
votes0
answers37
viewsRemove Fixed lenght from SQL Server
The string fields of the tables in my database are coming with Fixed length as true. So if the size is 60, and I save a string with a size of 30, it fills the string with spaces up to the full size.…
-
0
votes3
answers84
viewsWhat are the good practices of MVC with Entity Framework?
I would like to know what are the good practices of MVC using the Entity Framework, regarding the MVC folders. When I create the Entity Framework, it automatically creates the database file, and the…
-
0
votes0
answers67
viewsEF Core - Map dynamic columns to a list
I need help in mapping EF Core entities. I have table products and this table can contain different columns depending on customer customization, they will always be text columns. I have a table and…
c# .net entity-framework entity-framework-coreasked 6 years, 3 months ago Eduardo Abreu dos Santos 152 -
0
votes0
answers64
viewsQuery on table name by Reflection
I’m trying to make a query in the table, which her name will come by the scope of the method, but does not allow me to use Select(); or Where(); System.Type referenceTableType =…
-
0
votes2
answers46
viewsHow do I complete information that is in a complex JSON type?
I am trying to carry out the filling of a Icollection type that is owned by my Professional model. When performing the request I pass the information via JSON But in VS debug and GET the information…
asp.net-mvc json entity-framework relational-model modelasked 6 years, 1 month ago Fabricio Pereira Cardoso 33 -
0
votes1
answer45
viewsDoubt when searching for items with Entity
Guys, I have to pick up all the sales items concretized. Every item is recorded with a CART in a sale, in the sales table I have the CART. How do I get all these items? I made this code: public…
-
0
votes1
answer24
viewsRender different Partialviews randomly
I have the following scenario: I have to move on to a view data from different tables (similar data, but without any relation), until then I got good. I created a class (viewmodel) that receives the…
-
0
votes0
answers97
viewsRecords in Icollection<> navigation property are not being recorded
I’m trying to make an inclusion of items in a list property but I’m not able to include the records in the database. First I have the following class models: public class Frota { public Frota() {…
c# asp.net-mvc entity-framework entity-framework-6 asp.net-mvc-4asked 8 years, 11 months ago JamesTK 901 -
0
votes0
answers194
viewsProvider: SQL Network Interfaces, error: 26 - Error Locating Server/Specified Instance
Hello friends, I am making a web application with Entityframework using Codefirst and every time I try to access, add or edit data has given the error below. Can anyone help me? I work with…
-
0
votes1
answer29
viewsChange scaffold C#generated controllers
Good people, I was studying about Entity Framework and saw that there is the scaffolding tool that generates a complete CRUD with controllers and views. My doubt is that if I can change the logic of…
-
0
votes1
answer855
viewsLocation and maps
Hello, I will work on an application that I will have to work with localization and maps, basically the user will inform an address and will appear to him nearby locations, so I wanted to know +-…
-
0
votes0
answers31
viewsC# MVC - Different context
Good morning, I have two Dbcontextprincipal and Dbcontexthist context that have the classes Bill and Contahist, respectively. In the main Dbcontext has the class Client. I would like to do the Join…
-
0
votes0
answers29
viewsSpecify Oracle Entity Framework version
Today we are working with two versions of oracle 12c and 11g. The development is carried out in version 12c. When using the Entity Framework to perform an Count, the same is applying a function that…
-
0
votes1
answer40
viewsDoubt Entity Framework Core
I’m learning to program using EF, I’m doing from BD First, I have a BD from another project, and I would like to create a solution based on this comic, I decided to leave very quietly, starting with…
-
0
votes0
answers34
viewsWhy use Asp.net core DI Container in conjunction with Onconfiguring the Entity Framework?
In many projects I realize that people tend to pass the Connection string both by dependency injection and optionsBuilder in the overlay of the Onconfiguring method.... What’s the point of using…
-
0
votes1
answer41
viewsQuery n:m using the Entity Framework
My problem with doing a "Many-to-Many" query. Receiving a View ID. In other words, I receive an id from the selected framework. 1 Catechesis has a list of parishes and 1 Parochia has a list of…
-
0
votes1
answer108
viewsOne-To-One relationship with the same Entity Framework table
I don’t know how to perform the relationship one to one on the same table on Entity Framework. Example: namespace cruddef.Models { public class Document { public int DocumentID { get; set; } public…
entity-frameworkasked 4 years, 9 months ago Higor Bandeira 25 -
0
votes1
answer158
viewsDoes Entity Framework need Session and Httpcontext?
I watched some videos about Entity and saw two different versions, in a first was something simple and direct (I believe the raw form of the Entity), where it just instantiated the context of the…
-
0
votes1
answer28
viewsHow to make an M:N autorelationation in the Entity Framework?
Good afternoon, I need to self-relatify and I’m really confused how I’m supposed to do this. In my system I have several process variables, a same process variable can be Father of several other…
-
0
votes0
answers89
viewsHow to order a Collection according to the Date and Time in C#?
I need to order the Personal Collection? You’re not ordering... Someone knows how to do this? public Pessoa GetJoinById(int id) { var pessoa = Db.Pessoa.Find(id); Db.Entry(pessoa) .Collection(x…
-
0
votes0
answers688
viewsError in Discriminator Column EF code first
I am doing a project in Asp.net, I am using classes in C# to make the connection with the bank, however, every time I try to insert a user in the bank, generates the following error: invalid…
-
0
votes2
answers50
viewsHow do I reference a context in Entityframework?
I am developing a c# API and I use the Entity framework and I need to create an Migration. My API needs to connect with two databases the internal database and an external database, with this, it…
-
0
votes1
answer86
viewsSelect with two context in entityframework
I need to make a comparison, from two databases, I need to bring the emails that do not exist in the other bank. I tried to do it this way: var email = _contextVO.Usuarios.Where(x => x.Ativo ==…
-
0
votes0
answers38
viewsHow to make a history
Hi, I have a question and I don’t know how to begin to resolve it. I’m using the Asp.net mvc and I have to create a history table, where it makes a copy of a certain part, even if I delete the…
-
0
votes1
answer33
viewsEntityframework - Error table or view does not exist
I have a table in oracle that can only be accessed this way sms."User", when mapping the entity, I did so: builder.ToTable("sms.Usuario") When running the project and seeing the log, I see that the…
-
0
votes1
answer24
viewsError creating a Controller in the API with Entity Framework
Good evening I’m trying to create a Controller in an Api with Entity Framework, associated it to the project, configured the dependency injections, but when I create a Controller it returns the…
entity-frameworkasked 3 years, 9 months ago Mfecosta 5 -
0
votes0
answers22
viewsError when trying to Add MVC Controller with views, using Entity Framework
Hello, when I try to create a Controller gives the error attachment. Does anyone know how to fix it? Thanks.…
-
0
votes0
answers27
viewssum the values of the repeated names in Datagridview
Hello, folks all right, I have an application where I add the items in Datagridview, however I want to add the volume values, the lines that are with the same name, I want to create a variable to…
c# sql-server entity-framework winforms visual-studioasked 3 years, 4 months ago Mecleudio Queiroz 31 -
0
votes0
answers40
viewsLINQ not recognizing method that returns a Boolean
I’m having this mistake when I try to perform a query with the Entity within a Iqueryable. "LINQ to Entities does not recognize the method 'Boolean Checkpast values(Int32)' method, and this method…
-
0
votes0
answers13
viewsedmx Entity Framework error
Gentlemen, I cannot update a table in the system, which I do maintenance due to the following message : The model was generated with warnings or errors. Please see the Error List for more Details.…
-
0
votes1
answer51
viewsReturn in JSON
You guys, a doubt. Making an API on NET 5 and using EF, when I make a query for related data the return on JSON gives error 500. // GET: api/Estadoes/5 [HttpGet("{id}")] public async…
-
0
votes1
answer31
viewsDuplicate Username - Entity Framework
I am in an ongoing project, today has already been installed the Entity framework. But what happened, it doesn’t let add users with the same name, which makes no sense, since they can have equal…
-
0
votes1
answer790
viewsSUM within SUM Entity Framework performance
I made a query with Entity framework and I’m having problems with performance. public static Decimal ValorPrevisto(this ClinicaModel clinica) { return clinica.Contratos.Sum(c =>…
-
0
votes1
answer385
viewsUpdate , Insert into Entity Framework Using View?
I have a mistake in my project when trying to give a Update or a Insert via the Entity Framework, where view database. I read in English stackoverflow that I can’t perform update or Insert via view…
-
0
votes1
answer50
viewsObjects Entity Framework
I’m having a question with Entity Framework I have a situation where I want to implement a database structure of an accounting plan, for example: the active current account ID 1.1 is the parent of…
-
0
votes1
answer186
viewsError while writing data from some tables via application
I have an application in Asp.net mvc that, among other functions, registers personal data of customers. We recently switched the database access from one server to another, which has a copy of the…
-
0
votes1
answer52
viewsAPI error published in Azure
I have an error in an ASP.Net API with Entity Framework and Mysql, on my machine the application runs smoothly access the database and shows the results, however when I publish in Azure the…
mysql entity-framework windows-azure publishasked 8 years, 6 months ago Eduardo Barbosa Oliveira da Si 45 -
0
votes1
answer321
viewsEntity Framework - Objectstatemanager Error
I am getting the following error when trying to update an entity in EF: {"An object with a key that matches the given object’s key could not be located in the Objectstatemanager. Check that the key…
-
0
votes0
answers566
viewsError with Entityframework preview
This is the message that is returning in the browser The Entity Framework Provider type 'System.Data.Entity.SqlServer.Sqlproviderservices, Entityframework.Sqlserver' Registered in the application…
-
0
votes1
answer814
viewsDelete Cascade with Entity framework
I have the following situation: my database is Mysql, when I try to delete a record directly in the database, from this message: Cannot delete or update a parent row: a foreign key constraint fails…