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
votes1
answer172
viewsPerform database mapping for Dbset<T>. Sqlquery()
Error while running Sqlquery on my Dbset. There is no mapping of the object type System.Data.Entity.Core.Objects.Objectparameter for a native type managed provider. I would like to leave my database…
-
1
votes1
answer103
viewsInput Entityframework C#
I have 3 Entity, where are Countries, States and Cities. I am performing the Crud of the City Entity, and saving is asking for the relationship of States and Countries, but this I do not need,…
-
1
votes1
answer588
viewsEntity Framework Relationship Error
I am developing a test project that I intend to include in my TCC, but I found a problem when relating two entities to create the Tablas in the database with the Entity Framework. Are they 'Post'…
-
1
votes1
answer1819
viewsError: Entitytype<T> has no key defined. Define the key for this Entitytype
When running my application, the following error is generated: One or more validation errors Were Detected During model Generation: Ballpoint.DataAccess.Context.Booktable: Entitytype…
-
1
votes1
answer102
viewsProblems while recovering data from BD with Entity 6.1.3 and Web API
I did a test project, called quotation to use the Web API and Entity. Well, I went to my web.config and created my connection string like this: <add name="CotacaoContext" connectionString="Data…
-
1
votes0
answers22
viewsI cannot show error in my view
Well, I have a view and I can not show the error messages, the code is very large and put in a summary but need some part I am editing. Controller Before it was like this: if (!ModelState.IsValid) {…
-
1
votes1
answer27
viewsMigrations adds the letter S in the table name
I have a model: public class pimentel { [Key] public int id { get; set; } public string cod_item_Crm { get; set; } public string tag { get; set; } public string data_anal { get; set; } public string…
-
1
votes0
answers14
viewsQuery error using Entity Framework with Mysql and VB.net
I have developed a method to do with simple query provided by the Changed textbox event and the query returns the right values the first time. When I change the value of the component and the query…
-
1
votes2
answers706
viewsMultiple error Object sets per type are not supported
I have a bug in my application. I am working with Identity for user authentication however when calling Controller created is returned me the following error: Multiple Object sets per type are not…
-
1
votes1
answer294
viewsImplementing the concept of inheritance in a database
Why the attribute PessoaJuridicaId is not generated? This is the base class Pessoa: public class Pessoa { public Pessoa() { DataCadastro = DateTime.Now; } public int PessoaId { get; set; } public…
-
1
votes2
answers733
viewsASP.NET MVC Entity - Scaffolding for more than one table simultaneously
I saw that an ASP.NET MVC project with C# has 2 magic tools that are Entityframework and Scaffolding. With them it is possible in a few minutes to have all the features of registration with in the…
-
1
votes1
answer503
viewsASP.NET MVC + Entity - How to map new tables
Good morning, I have a project using ASP.MVC + EF and mapped about 20 tables using the VS wizard (creating the ADO.NET Entity Data Model, selecting the database and the tables I want), but now I…
-
1
votes1
answer474
viewsHow to bring other columns with Groupby with LINQ
I have two tables: 1st Process containing Processoid and Situacaoprocessoid 2nd Situationthe process that contains Situationthe Process and Description Models: public class ProcessoModel { public…
-
1
votes1
answer396
viewsEntity Framework vs SQL Injection (security?)
Hello! I’m new to development so excuse me if the question is silly. If it’s thanks link’s with references so I can better inform myself. As much as I understand the concept and the use of SQL…
-
1
votes0
answers132
viewsQuery using the Entity Framework
I’m a beginner in the Entity Framework and I picked up a software for maintenance that uses the Entity. I need to create a report and do the following SQL search using Entity: select p.RA, p.Nome,…
-
1
votes1
answer256
viewsDisable Lazy Loading for a specific query
I have a problem of slowness at the time of bringing the data. I have in the table 16 thousand records that are taking about 6 seconds to be brought from the bank. I noticed that when bringing these…
-
1
votes0
answers22
viewsI cannot map EF
I have this entity in my domain: public class CalibrationToolActivePart { [Key] public int CalibrationToolActivePartID { get; set; } public int CalibrationToolID { get; set; } public int…
-
1
votes1
answer169
viewsError While Running Migrations
Friends, I have two entities Deliveryfee and City, where Deliveryfee has a FK from City, when I went to withdraw the relationship between the two and ran the Migration he returned me the following…
c# asp.net-mvc entity-framework asp.net-web-api migrationsasked 7 years, 1 month ago Thiago Ubiratan 353 -
1
votes1
answer210
viewsEviar view parameter for action
I have a views that lists my users, is basically in the pattern generated by Asp.net mvc with Entity, the data is in a table, and within this table I have a : @Html.ActionLink("Aprovar cadastro",…
-
1
votes1
answer114
viewsError trying to change a user’s role
I am getting the following error while trying to change a user’s role : Server Error in Application '/'. UserId não encontrada. Descrição: Ocorreu uma exceção sem tratamento durante a execução da…
-
1
votes0
answers147
viewsHow to compile C# code at runtime in an ASP.NET MVC5 project?
I tried to use the CodeDom, but when trying to find a DLL specific to execute my code the command Assembly.GetEntryAssembly().Location always returns to me null. It seems the projects ASP.NET are…
-
1
votes2
answers138
viewsTolist() returning read-only
Follows code: using (var db = new Entities()) { var result = db .Tabela1 .Select(x => new { x.Coluna1, x.Coluna2 }) .ToList(); foreach (var item in result) { if (item.Coluna1 == string.Empty) {…
-
1
votes0
answers29
viewsproblem with Entityframework
see the return of the script, running directory in mysql, by sqlYog: However, when I run in Visual Studio, the return is different: Serialized result: "TotalMesAMes": [ { "mes": "January", "status":…
-
1
votes1
answer160
viewsGeneric CRUD in Entity Framework with unspecified entity
I’m trying to make a generic CRUD for my project. However as I used Databasefirst I do not see how to have a generic class of Entity that can be inherited. Because it doesn’t make any sense,…
-
1
votes1
answer341
viewsAspnet.Identity Creating user with Role
It’s the first time I’m working with Entity and Identity and I’m confused about how to persist my user. Basically I have a table User, with several relationships with the bank and Id int) I have the…
-
1
votes1
answer122
viewsHow to instantiate a part of a class with Entityframework working with CRUD only on these data
I am creating a solution for the web in the Singlepageaplication (SPA) type made with Aspnetcore and I use the Entity Framework to make my CRUD in the SQL Server database. I am sure that the Entity…
-
1
votes2
answers126
viewsHow to insert a Where into a Linux query
I have the following query: var result = (from line in db.ApadrinhamentoListas group new { line } by new { line.datahora, line.valor_doacao } into grp select new { DataHora = grp.Key.datahora, Valor…
-
1
votes0
answers153
viewsEntity Linq consultation in many-to-many relationship
I inherited a bank that is untouchable... despite having some very "strange" things. For example I have the following situation that would represent an n-n relationship but the relationship does not…
-
1
votes1
answer1228
viewsRelationship 1 - N Entity Framework
I’m developing a test project and I’m having a problem with 1-N relationship with the Entity. Model Cab_venda: public Cab_Venda() { Det_Venda = new HashSet < Det_Venda > (); } public int id {…
-
1
votes0
answers512
viewsHow to hide properties of an ASP.NET Core model entity only in JSON rendering?
I am starting studies with ASP.NET core Web Api, and am implementing the User class, which has a Password property. Logically I don’t want the password to be visible in the Jsons of the api. I’ve…
asp.net entity-framework asp.net-web-api asp.net-coreasked 6 years, 11 months ago Rômulo O. Torres 437 -
1
votes1
answer47
viewsAjax autocomplete in Entity Framework
I have following HTML code: <input id="pesquisaEstilo" name="pesquisa" type="text" placeholder="Destrito, Concelho" /> <input type="submit" value="Pesquisar" id="botaoPesquisar"/> I want…
-
1
votes2
answers190
viewsIn Development Code First how do I relate the Aspnetusers table to other tables
I am developing a system for real estate and need to relate the Table Aspnetusers with the tables that the system will have and with cardinality one for many, this I want so that the system can pass…
-
1
votes1
answer549
viewsCircular relationship with Entityframework Core
I need to relate the entity Person to Personal Registration using EF Core, but is giving the following error in Migrations: "The navigation Property 'Personal' cannot be Added to the Entity type…
-
1
votes0
answers155
viewsSaving a Lot to Many Relationship with Entity Framework
Doubts when inserting objects into the database when using Entity Framework 6 + C# WPF. I have 3 objects Ordemservico, Service and the Itensos. with the following structure: public partial class…
-
1
votes1
answer44
viewsHow to Create an N:N Table where one of the keys does not belong to a table of the same database
Context: The application has a module for record of calls and we use another application handle the incident record, both are in different database. Each call can be related to one or more incidents…
-
1
votes1
answer99
viewsError while trying to save data to two tables at the same time
Good morning. When updating a table my system has to save the current data in a historical table and only later save the form data in the table by doing the update. This is the action that receives…
-
1
votes2
answers555
viewsDo not update a particular EF Asp.net mvc field
I have a table that every time I create a new registration has the field Datacadastro, however when I want to edit I do not want to change the date that was registered and only changes the other…
-
1
votes1
answer203
viewsSelect all items with same Id in the same table
Very well, I will try to be as clear as possible. I have the stock table where will have there several products -> Productoid and its Quantity. In the same table the product can be repeated with…
-
1
votes3
answers363
viewsI cannot use the Find() method using Entityframework
I’m using the following tutorial to use the Repository Pattern: Follows my repository class public class Repository<T> : IDisposable, IRepository<T> where T : class { protected readonly…
-
1
votes1
answer92
viewsHow to assign a database value to a new object in C#?
I’m creating an app like a bench to train C, but I ran into a situation. I have a database with the tables Accounts, Clients and Tiposconta. In the table Tiposconta there are registered the item…
-
1
votes1
answer38
viewsGet Method with Customizable Where
I made a WebAPI (ASPNET with EF6) with verb support Get(), Post() and Delete(). At some point, I need to access certain values that are not returned by default by verbs, for example: The Order…
-
1
votes1
answer154
viewsProblem changing entity with E.F and Dapper
I have a Dapper query, where I search for an entity: var fatura = ObterPorClientedEDataVencimento(cobranca.ClienteId, cobranca.DataCobranca); The method and properties of my entity are in this Gist,…
-
1
votes1
answer374
viewsDoubt to enter record with foreign key. ENTITY FRAMEWORK
I’m a beginner (starting bemmmm) in programming, and I have a case to develop, which would be a Crud, using Asp.net (C#) and Entity Framework. I created a simple contact registration form, where…
-
1
votes1
answer174
viewsASP.NET Entityfraord - Grid with Pagination
I am building an Asp.net application using Entity framwork. To load the grid I use the following instructions: var lista = entity.Usuario.ToList().OrderBy(x=>x.nome); grid.DataSource = lista;…
-
1
votes1
answer216
viewsDDD + Entityframework + Migrations + SQL Server
Hello, I have a Solution that I am implementing the DDD architecture with Entityframework, Migrations and SQL Server! However I am not able to connect to my local database when performing the…
-
1
votes1
answer245
viewsRelationship of one column to several
I have an entity class called Doctor, in which it has an Idmedic column. It relates to the class entity Care, which in turn has an Idmedico column, which would be a foreign key of this first. There…
-
1
votes0
answers49
viewsDoubt Json MVC Core Razor
I have created a method to perform a Insert through Ajax, thus: function SalvarHorario() { //NomeHorario var nome = $("#Nome").val(); var token = $('input[name="__RequestVerificationToken"]').val();…
-
1
votes0
answers60
viewswpf application with Entity framework does not work on another machine
I have a wpf application with Entity framework and sql server express...works perfectly on my pc, but when I try to install it on another computer it does not work...the application does not create…
-
1
votes0
answers36
viewsHow to use Graphdiff Entity Framework Code First
I have the following tables in my database: Sale Detailing Productsresulture Plots The relationship is as follows: 1 Sale => N Detail 1 Sale => N Productsrelations 1 Detail Spreads => N…
-
1
votes1
answer207
viewsHow do I not map a Class with the Entity Framework
I’m making my first system (C# ASP MVC 5) with Entity Framework and Migrations. I have my classes mapped correctly and migrated to the Database that is SQL Server 2012. But the question is how I can…