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
votes2
answers483
viewsMatch content of two objects
Use the method below to update a given table: public int alteraBem(tb_bens itemBem) { try { using (GestaoAtivoEntities db = new GestaoAtivoEntities()) { var bem = db.tb_bens.Where(v =>…
-
0
votes1
answer402
viewsError saving data from a session in the database
I am developing a sales system. Follow the link: Save Request - ASP.NET MVC However when finalizing the purchase and saving the data in the bank, I get the following error: "An Entity Object cannot…
-
0
votes2
answers161
viewsPostgresql oid column attribute type with EF6
What type of attribute should I use to represent a type column oid of Postgresql with Entity Framework 6 Code-First? Remembering that the type oid Postgresql is for storing files.…
c# .net entity-framework postgresql entity-framework-6asked 8 years, 6 months ago Matheus Saraiva 2,157 -
0
votes1
answer221
viewsInstruction Left Join in LINQ to entites
I tried to do a left Join on LINQ as follows: (from opr in db.Operacao join vol in db.Volume on new { VOL_CODBAR = opr.OPR_CODBAR } equals new { VOL_CODBAR = vol.VOL_CODBAR } into vol_join from vol…
-
0
votes1
answer1699
viewsHow to save the same object in the database using entityFramework . net MVC?
I need to update a table in the database using entityFramework, because when I update a value of a field and have it saved ,. Please someone has a way to fix this?? grateful…
-
0
votes2
answers822
viewsHow to return more than one database Entity in a LIST?
I have two entities, CATEGORY and TRANSACTION, on the bench I also have these two tables. TABELA: CATEGORIA CHAVE: ID TABELA: TRANSACAO CHAVE: CATEGORIA_ID When performed a select for Entity…
-
0
votes1
answer51
viewsMethod returning object name in Entity
I have the following method: internal ArquivoVersao GetArquivoVersao(string arquivoVersaoGuid) { using (var ctx = new TestEntities()) { var versao = (from ver in ctx.ARQUIVO_VERSAO where…
-
0
votes2
answers761
viewsArgued tofrangeexception with Entity
I have a method that waits for a file object, what it does is add the references in the database: Look at the method: internal void AddArquivo(Model.Arquivo arquivo) { using (var ctx = new…
-
0
votes2
answers1763
viewsError updating Entity entries
I’m trying to insert some data from some files by Entity, but it keeps giving this error: Method: internal void AddArquivo(Model.Arquivo arquivo) { using (var ctx = new TESTEntities()) { var versao…
-
0
votes0
answers154
viewsValidation error in Entity framework
In my method of adding ta files giving the following Exception when debugging: Validation failed for one or more entities. See 'Entityvalidationerrors' Property for more Details. Method: internal…
-
0
votes2
answers285
viewsMethod to edit data with Entity
I am developing a file manager and have already implemented some methods like addArquivo, listarArquivo, listarVersoes, etc.. But I need to edit it, check my DAL methods: Add: internal void…
-
0
votes1
answer181
viewsList method does not return objects
Method with RU List internal List<Arquivo> GetAllArquivo() { using (var ctx = new TESTEntities()) { var arquivos = ( from ver in ctx.ARQUIVO select new Arquivo() { ARQUIVO_GUID =…
-
0
votes1
answer111
viewsHow to delete data from one table related to another
I have the following situation with a method of deleting directory: internal void DeleteDiretorio(Model.Diretorio diretorio) { using (var ctx = new TESTEntities()) { var dir =…
-
0
votes1
answer101
viewsDoubt about Entity Modeling
I have an entity called Requests that satisfies the following business: A request is made by an Employee(Entity), then it is changed by another Employee and then confirmed by a third Employee. In a…
-
0
votes0
answers125
viewsRemove() from Entity Framework 6 only works when recreating the connection
I am creating an EF6 application and I came across a problem. I am using the concept of repository and when I run a delete (context.remove(obj)) and after that I reload the list and datagrid, I…
-
0
votes1
answer132
viewsThe Member with Identity '' does not exist in the Metadata Collection?
I couldn’t find how to solve this problem between my base and my mapping using Fluent API. I have a Fluent API mapping of a certain pre-existing table in the client database, but this table has a…
-
0
votes2
answers7710
viewsUnable to locate Data Provider . Requested Net Framework. Sql Server + Entity
I’m having trouble connecting with my local bank. This is my View, where I try to connect the bank using Razor: @{ ViewBag.Title = "Index"; Layout = "~/Views/Shared/_LayoutOuvinte.cshtml"; var db =…
-
0
votes2
answers391
viewsIs there a difference between First and Single?
There are some differences between First and Single? the return of the two consultations are equal? And in the performance between the two is the same? Which of the two expressions is best used?…
-
0
votes1
answer140
viewsQuery with Linq to Entities in Many-to-Many relationship
I have the following tables in a database: The table Coursesprofessors joins the relationship Many-to-Many between the tables Courses and Teachers. I have been trying for a long time to do a query…
-
0
votes1
answer171
viewsconfiguring Entityframework C# and SQL Server
"the element 'entityFramework' has invalid Child element 'providers'. List of possible elementes expected: 'contexts'."
entity-frameworkasked 7 years, 10 months ago MARCOS 1 -
0
votes1
answer455
viewsHow to run SQL with Entity Framework?
I tried to execute a command SQL for Entity Framework, tried in the following ways: string cmd = "UPDATE t0071_compra SET t0071_status = 'Enviado' WHERE t0071_id_compra = 4 AND t0020_id_empresa =…
-
0
votes1
answer47
viewsDoubt in consultation with Entityframework
how do I consult with EntityFramework? with lambda or linq SELECT t0051_id_medicamento, t0100_lote, SUM(t0100_qtde) FROM t0100_historico GROUP BY t0051_id_medicamento, t0100_lote;…
-
0
votes1
answer96
viewsThe Member with Identity 'Faseprojeto_fase_target' does not exist in the Metadata Collection
I’m making a very strange mistake... I don’t have a clue. This is my class: public class FaseProjeto { public int IdProjeto { get; set; } public int IdFase { get; set; } public virtual Projeto…
-
0
votes1
answer59
viewsHow do I reference Entity Framework 6 from . Net Core Class Library?
When installing the Entity Framework by Nuget I got the following error in its reference: The dependency Entityframework 6.1.3 does not support framework . Netcoreapp, Version=v1.6 How to get around…
-
0
votes2
answers192
viewsLog in with Asp.net 4.5 (Entity Framework)?
How can I make a Select using Entity Framework, and check if the record exists ? Example: txtlogin.text txtsenha.text Login table. user camp password field valida() class created to execute the…
-
0
votes1
answer199
viewsDataannotation validations do not work on properties with Notmapped attribute in EF6
I upgraded the Entity Framework version from 5 to 6 in my project, and Context.Savechanges from the Data Repository stopped working only in some cases. I found that using Dataannotation in the…
-
0
votes1
answer91
viewsError connecting to Mysql using EF6
I’m getting the bug 'System.Data.Strongtypingexception: The value for column 'Isprimarykey' in table 'Tabledetails' is Dbnull Whenever I try to connect to a Mysql database using Entity Framework 6.…
-
0
votes0
answers149
viewsMVC + EF application with N-Layers
I am working on an MVC project with EF 6, and I am having a very curious problem, in some Viewmodel, the object that comes from my Dbcontext does not seem to persist and I get the generic message…
-
0
votes1
answer277
viewsLINQ to Entities x Lambda Expression
What is the difference between LINQ to Entities x Lambda Expression? Still using LINQ to Entities in the Entity Framework or is there something new?
-
0
votes1
answer32
viewsmodelBuilder add only one variable with different varchar
On my system, I have a small code that adds varchar to all variables added in the database modelBuilder.Properties<string>() .Configure(p => p.HasMaxLength(150)); only that I need only one…
-
0
votes1
answer2189
viewsHow to fix System.Collections.Generic.Ienumerable error
My application that manages Courses is making that mistake O item de modelo passado para o dicionário é do tipo 'System.Collections.Generic.List'1 [MeuProjeto.Models.Curso] ", mas este dicionário…
-
0
votes2
answers1454
viewsapply filter in return from a list
I’m making an appointment where I have one array of situations ex: 1, 2, 3 in the query I have to filter through these situations, follow my code. var array = GetSituacoes(); var lista = bll.Query(p…
c# entity-framework linq lambda-expressions linq-to-entitiesasked 7 years, 6 months ago Thiago Ubiratan 353 -
0
votes1
answer71
viewsEntity Framework database access
I got a C# . NET application developed with Entity Framework, but I can’t access the database, with the following message: The underlying pdovider failed to Open. I only have the application, but no…
-
0
votes1
answer174
viewsPopular Datagridview with Entity Framwork
I have in SQL Server a database called STORE; In this database I have a table called Funcio, it contains 5 columns and they are respectively: Name, CPF, Date, Date issued, Idfuncionario. In my C#…
-
0
votes2
answers427
viewsMany-To-Many Entityframework update does not work
I have a relationship N:N between Activity and Project, where an activity has many projects: public class Atividade : ObjetoPersistente { public Atividade() { StatusAtividade =…
entity-frameworkasked 9 years, 4 months ago Joaquim Magalhães 169 -
0
votes2
answers179
viewsTool to generate poco
I have a postgre bank with several tables and I need to generate their classes. Is there a free tool that manages the pocos to be used with EF6? I searched but did not find. I am using VS2015 and…
-
0
votes1
answer64
viewsRelationships with the Entity Framework?
Next, I’m modeling the domain class of a system and I’m having a hard time understanding certain things from Entity Framework, so I hope you can help me, aiming that I’m following the idea of Code…
-
0
votes1
answer136
viewsError editing record more than once with Entityframework C#
When editing a record and saving for the first time entityframework performs the update successfully, but when I click again on edit and save the record I come across the following error: Error…
-
0
votes0
answers559
viewsError creating controller using Entity
In my Employee Registration project I have the following folders: MODEL CONTROLLERS DAL VIEWS From the moment I create a controller using the Entity that already creates me right my view he makes…
-
0
votes1
answer182
viewsChange Primarykey Entityframework
How to change a Primary key using Entityframework? I have a table with simple PK and need to change this PK by Entityframework.
-
0
votes0
answers82
viewsReference of forein key, with the Entity Framework
I’m having a hard time making one Insert, because the FE indicates that there is error in the table reference. But, in my config, I state what is the foreing key. My config: public class…
-
0
votes0
answers151
viewsHow to find out the type of relationship between two tables
Hello, everybody I wanted to know a way, or better, if there is a way to find out through a SELECT the type of relationship between two tables wanted me to return. SELECT TABELA_PRINCIPAL,…
entity-frameworkasked 9 years, 3 months ago Rodrigo 381 -
0
votes1
answer729
viewsEntity delete table and your relationships
Is there any way to delete a table record and all your relationships at once? because I currently delete each related record before deleting the main record, and it takes a long time, for example I…
-
0
votes0
answers40
viewsAccess FK attribute in Entity Framewokr
I have the class Cliente who owns a IList<Produto> and the class of produto has a ClienteId (which is FK) and an attribute Cliente Cliente { get; set; }. How to access the attribute Nome of…
-
0
votes1
answer79
viewsConflict between similar objects in the Entity Framework
I have the following class: public class Conteudo { public long Id { get; set; } public string Categoria { get; set; } public string SubCategoria { get; set; } public string Descricao { get; set; }…
-
0
votes2
answers207
viewsENTITY FRAMEWORK - make a query like SQL
Fala Pessoal, I have a problem that may be not doing correctly, I have a query in a table description field for example Select description table Where field like 'test%Description' How do I do this…
entity-frameworkasked 7 years ago Alex Becker 107 -
0
votes1
answer134
viewsAdo.Net and Entity in the same project
I took a test to do and it is mandatory to use Ado.Net, but it would be a differential the use of Entity. I’m a little confused about this. Ado.Net and Entity gives ball?
-
0
votes3
answers138
viewsDynamic dropdown list and comic return image does not work
Dropdown dynamic list and database image return does not work after the application is published on IIS. When Inspecting through the browser I had the following error: HTTP 404.0 error - Not Found…
-
0
votes1
answer137
viewsNuget - Entity Framework error
I’m starting with C# and I need a force. I tried to connect to the database using the entity framework. In the output of the visual studio came the following message: System.Typeloadexception: Could…
-
0
votes0
answers483
viewsData provider . net framework requested. maybe it is not installed
I use Entity framework 5 in an MVC project. When I had Framework 4.0 installed on the PC it worked perfectly. Now that I have installed the . Net framework 4.5 SDK and the 4.6 framework while…
entity-frameworkasked 6 years, 10 months ago Paulo Augusto Batista 1