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
-
1
votes2
answers317
viewsRandom list in Query Linq to Entity C#
I would like to get a list of 3 objects within a query Link. var listaPessoas = from i in this.Context.CreateObjectSet<listaPessoas>() select i; ... listaPessoas = listaPessoas .Where(x =>…
-
1
votes1
answer173
viewsInner Join in tables 1 - n
I have two tables: Vehicle and Images, where a vehicle can have n images. When performing an Inner Join I get the following result: Vehicles1-Addressimage Vehicles1-Addressimage…
-
1
votes2
answers619
viewsHow to get data from two tables in the same column?
I have two tables in the database: Tabela1 Id Nome Sexo 1 NomeA Macho 2 NomeC Fêmea Tabela2 Id Nome Sexo 1 NomeB Macho 2 NomeD Fêmea I would like to have the following result: Id Nome Sexo Tabela 1…
-
1
votes1
answer51
viewsExit from my service does not match my dto
On my way out of service to the Dadositens camp, I have this: <DadosItens> Qtde 3 Custo 46,66Unitario 68,58 Margem 0Ult.Cond 30/01/2017 C. Diario 46,66 Total 205,73 </DadosItens> Turns…
-
1
votes1
answer2229
viewsIdentifying the foreign key in the Codefirst Entity Framework
The Entity Framework identifies the foreign key through properties that have Id as part of the name or by Data Annotation [Key]. My question is, how does it identify foreign keys and makes the…
entity-frameworkasked 9 years, 3 months ago Kelly Soares 1,181 -
1
votes0
answers31
viewsHandling Entity Framework Data Using C#
I have a database connection using the Entity Framework. The code is as follows: public IQueryable Empresas() { int idUser = Int32.Parse(self.IdUser()); var res = from s in db.EmpresaUsuario join c…
-
1
votes1
answer159
viewsLinq function does not return List
Hello, I have an application and it does not return a list I select via Linq-to-Sql The error may be in the SELECT that Linq-to-sql is doing. SELECT [Extent1].[Codigo] AS [Codigo],…
-
1
votes0
answers127
viewsMysql Database does not connect with Entity Framework
Galera to trying to connect a Mysql database with c# through the Entity Framework, but every time I click on the next button comes to nothing(with Sql Server goes the problem is with Mysql)…
-
1
votes1
answer348
viewsQuestions with Entity Framework (Navigation Properties and Create method)
I have been reading several articles and so far I could not understand the real function of the navigation property. In the last articles I read, it said that it serves as a foreign key for…
entity-frameworkasked 9 years, 2 months ago Kelly Soares 1,181 -
1
votes0
answers280
viewsAdd field of decimal type Entity framework
I have a Repair table in it I have Valuemade, Value and Total Value all of the decimal type. The Value field = Valuemaod + Value Library. However this returning 0. I am showing this in the Detail…
-
1
votes1
answer119
viewsInstantiating the database context in the controller
Hello, I have a question related to the Dbcontext instantiation mode in the controller. What is the difference between the two methods below instantiation ? 1. private ApplicationDbContext _db;…
-
1
votes1
answer235
viewsSelect with Entity framework in N : M with multiple objects
I have the following classes: Client, Contact, Phone, Campaign and Campanhacliente. Where Campanhacliente, has a campaign, has a Customer ( who has a phone list and a contact list and who may have a…
-
1
votes1
answer54
viewsError with 1 relationship for many, Power Tools does not generate model
I want to make relationship one for many in EF where one and only Territory has several regions, but when analyzing the model in Power Tools it does not recognize. Region [Table("Regiao")] public…
entity-frameworkasked 9 years, 2 months ago Kelly Soares 1,181 -
1
votes1
answer44
viewsLike the Entity Framework Trackeia objects?
I read several questions of the type, but I find my question very specific: How does the Entity framework "trackeia" the objects? That is, as when loading an object and even without sending the…
-
1
votes2
answers337
viewsNo Entity Framework provider found for ADO.NET provider
I am splitting my application in layers, I installed the EF in the application layers and repository, in my view everything is correct, but I am having the following error: No Entity Framework…
-
1
votes1
answer318
viewsHow to pick up the percentage of Postgre database storage space via EF Core in Asp.net Core
I need to create in my application a feature that checks in the database (PostGreSQL) the percentage of storage space used to be shown in a graph. I have a generic repository, and I thought I’d…
asp.net entity-framework postgresql asp.net-mvc-5 postgresql-administrationasked 6 years, 8 months ago Master JR 1,853 -
1
votes1
answer122
viewsView 3 Models in a View
I have 3 Models and I need to assemble 2 (two) lists and a "Save) button": Class: Tbproduct: public class TBProduto { [Key] public int TBPRODUTOID { get; set; } public string DSPRODUTO { get; set; }…
-
1
votes1
answer493
viewsRelationship Problem with EF6 (Relationship and Associative Class)
I need to know if my auto relationship and my associative class are created correctly according to the original model made in the SQL Server Diagram. Original Model - SQL Server My model in Power…
-
1
votes1
answer118
viewsIs it possible to use the Entity framework from a class library?
Normally I use the Entity framework in an MVC project but I would like to know if I can use it from a class library project
-
1
votes2
answers129
viewsRegister an "admin" user when running the c# mvc application
good afternoon, I need some idea for a web system to automatically create a user Admin as soon as I run(open) the application. that is, when running the application with a zeroed database, so that I…
-
1
votes0
answers110
viewsError :An Exception occurred while initializing the database. See the Innerexception for Details
Someone could help me in this era that I always come across him and after numerous attempts, I can not find this error, I am developing an application in MVC 3 exploring more this part of the Code…
-
1
votes1
answer373
viewsProblems with Lambda and Datetime consultation
Hello I have the following Actionresult code from my controller below: [HttpPost] [AuthorizedUser] public ActionResult Load(DateTime DataInicial, DateTime DataFinal) { var AcessoDominio = new…
-
1
votes1
answer107
viewsEntity Framework + Fluent API + Web API?
I’m having trouble mapping the category within a product, when I list the products in the category (virtual class) comes empty, even with CategoryId filled. Product public class Product { public…
-
1
votes1
answer610
viewsFill date Automatically in ASP.NET MVC 5
Hello, all right? I need some help from you, I already searched here on the forum but I was not successful with the results. I have a small application where I control Digital Certificates, my…
-
1
votes1
answer255
viewsHow to write data in one table for many?
I have a question that still persists after making some searches. Is the following, assuming I have a form, where I register several emails to a single user, how I record these several emails in…
-
1
votes1
answer882
viewsHow to resolve error: The best overloaded method match for
Following the models of that question, when I pass the commands to write the form data to the database, before even copying Visual Studio, points out the following error: "The best overloaded method…
-
1
votes2
answers473
viewsSync items in comboboxes at runtime
I’ve been trying to figure out how to synchronize a combobox with another one for some time. I’m looking to synchronize comboboxes at runtime. When the user selects a category in the combobox,…
-
1
votes1
answer94
viewsString in expression Entity C#
I need to make a dynamic query similar to the example below String tabela = "NomeTabela"; Var x = db.("NomeTabela").ToList(); Something like this where the table name will change according to the…
-
1
votes1
answer48
viewsMapping with Entity Framework
Good afternoon, when analyzing a code I see in the mapping the following line: this.HasKey(t => t.IdEstudante); I understand what you do in practice but not theoretically, refers to the object…
-
1
votes1
answer149
viewssearch object list in Entity [LINQ]
I have a list of objects and would like to search 2 properties of that list in the database. with a list of primitive types I would do so: (from n in db.Tabela where…
-
1
votes2
answers499
viewsSql server skipping record id
After changing an application record, the next record I entered in the table skipped 1000 increments in id. id’s 2 3 4 5 6 7 8 9 1015 1016
-
1
votes2
answers44
viewsReturn the Dbquery property name using Generics
How do I get the name of the property DbQuery using Generics? I have the property: public DbQuery<Pessoa> ConsultarPessoas { get; set; } And in my repository:…
-
1
votes1
answer156
viewsEntity Framework Core - Composite Key
Until version 1.0 of EF Core I was having problems doing UPDATE on a database record that contained a composite key. If I tried to change the ID value of one of the compound key fields, it was not…
-
1
votes1
answer148
viewsConvert Query SQL Server to Entity Framework
How to convert a SQL of SQL Server for Entity Framework, Ordering field values as follows: of: ({'115-F-G', '10 -H-G ', '98 -T-R'}) for: ('10 -H-G ','98 -T-R','115-F-G') SELECT * FROM ReportePedido…
-
1
votes1
answer94
viewsInsert multiple Entity Framework items
I have the following method to add doclient data public void Alterar(CLIENTE Cliente) { using (Entity.DominioEntity db = new Entity.DominioEntity()) { //Alterar/Adicionar Telefone foreach (var item…
-
1
votes1
answer159
viewsHow to load an entity State-related Parents
I’m starting out in the Entity Framework and when trying to load a State entity, the related Parent entity is coming with null value, which I could adjust in my code to resolve? State class: public…
-
1
votes2
answers151
viewsHow to create Function in Database with Migrations Ef core?
I created a Function in Postgresql and would like it to be generated together with the database in the initial Migration. I tried it this way and I didn’t get any results protected override void…
-
1
votes2
answers121
viewsHow to format decimal numbers using Fluent API in the Entity Framework?
How to create a formatting with precision 10,4 (4 decimal places) to save decimal data to SQL Server? This format description goes inside the modelBuilder, however, I have not found any code already…
-
1
votes1
answer360
viewsHow to do Reverse Engineering via Entityframework using a Firebird data source in Visualstudio 2015?
I have an already populated Firebird database and would like to use this same database for a Web project in visual studio 2015. I would like to use a library class and generate the model using EF…
-
1
votes0
answers32
viewsMysql incorrect decimal value in view
I don’t know why the number 9937.77 stored in Mysql as Decimal(12.2) displays 9 million in views 1.00 displays 100 (1.00 is correct) 5.77 displays 577 (5.77 is correct) I tried to DisplayFor(m =>…
-
1
votes1
answer44
viewsFiltering items in a products table
Good afternoon to everyone, I have a simple application that I am developing, and I have the following problem, I have a variable "Tenure List", which already has the ID of the items, and I have a…
c# sql-server entity-framework winforms visual-studioasked 3 years, 5 months ago Mecleudio Queiroz 31 -
1
votes0
answers93
viewsThe database creation wizard does not appear in the service based database and does not create a string Connection in the app.config in the Entity framework framework
I’m taking a virtual course on Entity framework in which the instructor uses visual studio in the 2012 version and during class he creates a web form project and asks to create a database in the…
entity-framework webforms visual-studio-2015 app.configasked 8 years, 9 months ago Leonardo Gustavo Maran 93 -
1
votes0
answers224
viewsLayered communication
I have 3 layers , BLL, DAL and the Project. In the DAL layer is the ENTITY (automatically creates the Gets and Sets) and I want to use the Gets and Sets Because when it arrives in the project layer…
-
1
votes2
answers190
viewsRU with TPT inheritance and audit fields
Hello. I’ve looked for answers in TPT and Entity tags but I can’t find anything like it. My problem is trying to use an inheritance model (TPT) where tables have fields with the same name (example:…
-
1
votes2
answers534
viewsLINQ update of all listed items (changing the status of all listed items)
I have a Linq that presents data listed according to the required filters (date and unit) by the user and another filter to validate a code with another table (which is not the case). I wonder how I…
-
1
votes2
answers1579
viewsNOT IN in Inline using a sub-query
I am using as a basis the answer in: https://stackoverflow.com/questions/432954/not-in-clause-in-linq-to-entities I need to make a query where do not contain (NOT IN) the Ids coming from another…
-
1
votes1
answer966
viewsInsert via Entityframework error "IDENTITY_INSERT is set to OFF"
I have several models and for some reason one of them presents the following error: Cannot insert explicit value for identity column in table 'tbl_boleto' when IDENTITY_INSERT is set to OFF. I…
-
1
votes1
answer455
viewsFilter database-level results Entity Framework
I have the following question about using the Entity Framework. I have an abstract class for the class that communicates with the base. Aiming at the performance want instead of bringing all the…
-
1
votes1
answer41
viewsGive preference to results that have the parameter passed in the Entity Framework
I am trying to implement a data solution that displays first the values that have the parameter passed to then pass the other parameters. Example: In a product table has the following data:…
-
1
votes2
answers190
viewsEntityframework Storedprocedure recover parameter output
How to recover the Output parameter of a storedProcedure? SP Example: create PROCEDURE StoreProcedure_Name @ParametterWithNummvalue varchar(50) = null, @In_Parameter varchar(50), @Out_Parameter…
c# sql-server entity-framework stored-proceduresasked 8 years, 8 months ago Alexandre Previatti 630