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
votes0
answers46
viewsShow results of a Stored Procedure
I want to show the result of the trial in a List I added it to the model and generated this code. public virtual ObjectResult<string> SP_ListaDadosCarteiraPGC(Nullable<int> ano,…
-
1
votes0
answers213
viewsEnable-Migrations error in EF5 with Mysql
I have a problem in my project, when trying to enable Migrations in the project it generates an exception as below: > System.IO.FileLoadException: Could not load file or assembly…
-
1
votes2
answers275
viewsRecursion in the Entity-framework
I’m starting in c# and I’m having some difficulties with Entity-Framework. I have the following scenario: public InstituicaoMap() { // Primary Key HasKey(t => t.IdInstituicao); // Properties…
-
1
votes0
answers973
viewsA transport-level error has occurred when Receiving Results from the server
I have an app Asp.Net MVC 4 (with Entity Framework and SQL Server) that works normally on my application server, but now I had to work with redundancy and load balance with two new servers for the…
-
1
votes0
answers216
viewsAutomapper with related entity
Good afternoon, How to map the following entities public class Artista { public Artista() { ArtistaCategoria = new List<ArtistaCategoria>(); } public int ArtistaId { get; set; } public string…
-
1
votes1
answer38
viewsDoubt about entities Asp.net mvc
I have 4 tables: T1, T2, T3 and T4 and the table of Customers. What happens is that the tables T2 to T4 "should" be one. But as part of the data would be as if it were a table and its options, I…
-
1
votes2
answers261
viewsInheritance in the Entity Framework
I am now reading about cross domain inheritance in EF. I came across this example: public abstract class BillingDetail { public int BillingDetailId { get; set; } public string Owner { get; set; }…
-
1
votes2
answers353
viewsEntity Framework search as case sensitive
People I am using Entity Framework 6, Mysql, ASP.NET MVC. The problem is this: when I do a search through the form (my search view) EF is case sensitive. When I do the query directly in Mysql, using…
-
1
votes3
answers333
viewsProblem saving accent with Entity Framework and Postgresql
I need to migrate a system with SQLSERVER database to a Postgresql 9.3. I’ve never worked with Postgre before so I’m using Entity Framework 6 with model-first to make the process easier. The…
-
1
votes1
answer131
viewsCustomer entity type is not part of the model for the current context
I’m trying to reproduce this example of Entityframework with default repository, as follows the link: https://msdn.microsoft.com/pt-br/library/dn630213.aspx But it is giving the error described in…
-
1
votes1
answer105
viewsEF mapping for tables with variable name
I have several tables with the same structure, but with different names. Ex.: CREATE TABLE `log_historico_25072016` ( `lhis_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `lhis_cvei_id` INT(10)…
-
1
votes1
answer227
viewsWhen to instantiate the Icollection
I’m reviewing some programming approaches and falls into a dilemma with regards to where we should instantiate our navigation properties from EF ICollection. Many cases I see that the personal…
-
1
votes2
answers179
viewsEntity Framework Template and Domain Class
The notation of the Entity Framework is "very polluted" if you take into account how I am used to defining the Domain classes, wanted to know if it is correct to have an EF model class to represent…
entity-frameworkasked 8 years, 3 months ago Weslley_51 23 -
1
votes0
answers566
viewsHow to install Npgsql as a data provider for ADO.NET Entity Framework?
I’ve read everything you can imagine, but I’m out of luck. In Visual Studio 2015 Enterprise update 1, I followed exactly the steps as you describe the tutorial on the page…
-
1
votes1
answer218
viewsPrecision scaling using Entity Framework and SQL Server
There’s some time I’ve been noticing, something strange when saving values double in the SQL Server database with the Entity Framework. I noticed that when reporting a value ex: 12.23 after…
-
1
votes1
answer588
viewsIs it possible to leave connectionString dynamically?
I’ve read something and I know it’s possible to leave one connectionString dynamically in an ASP.NET MVC application. However, it is possible to create n connections where each authenticated user in…
-
1
votes1
answer95
viewsLinking Users to Businesses and bringing related records to the User’s company using ASP.NET Identity and Entity Framework
I have records in the database (example, clients), and in all records have an identifier EmpresaID. I’m using identity with Entity framework to authenticate. In the user’s registration I have an…
-
1
votes1
answer451
viewsHow to define Generator (from Firebird) for an Entity framework 6 model field?
For example: I have the following table: TABLE_EXAMPLO ----------- ID NAME And the following Generator: TABLE_EXAMPLO_GEN How I would map the entity so that the Entity Framework can call Generator…
-
1
votes1
answer107
viewsEntity Framework does not convert Firebird INTEGER to C#long
I am doing some tests with Entity Framework mapping and migrating a database of a legacy system. Setting Where I have a table similar to that: TESTE -------------------------------------- ID INTEGER…
-
1
votes0
answers61
viewsSelect from the Entity Framework of a table resulting from an N to N relationship
I do not know if it is very clear the question, so I will try to illustrate the scenario better. I created a table of Activities and a table of Users, in the table of Activities I have a responsible…
-
1
votes1
answer114
viewsEntity Framework (ORM) and Dropdownlist Html
Have two models we map that will work like this : The model Afazer will have a Combobox(Dropdownlist) which will make available the categories for the user to select, but these categories are…
-
1
votes1
answer973
viewsList of View objects for controller
I have two Customer and Address entity where the customer has multiple addresses. At the time of completing the form, the user can add two addresses in the same form and at the time of Submit, I…
-
1
votes1
answer164
viewsEntity Framework Contexts Error
I’m using two contexts of the Entity Framework, one for the Identity (which is in the cross Cutting layer) and another for my application (in the Data layer), both point to the same database. Date…
-
1
votes1
answer115
viewsJquery is returning Undefined to one of the generic properties I created
Jquery is returning Undefined to one of the generic properties I created, to use with Bootgrid. I’m trying to load a modal according to the event click one of the buttons on the grid, but the modal…
-
1
votes1
answer129
viewsConceptual doubt. Entity Framework, BLL and OOP
People, I request urgent help... I have a system that is running "right". Done in C# (Winform) and SQL Server (no Entityframework). However, due to studies and the need to expand the system (adding…
-
1
votes1
answer59
viewsFluent API modeling with reference table
I would like to know how I perform the modeling of a given entity, where its reference value belongs to another table. This benchmark would be a domain table that has your credit card id s, because…
-
1
votes0
answers208
viewsASP.NET MVC + Checkbox how to proceed?
I have a list where I register FOOTBALL TEAMS in CHAMPIONSHIPS, I mean, I need to select several teams for a championship, I make a list with checkbox but do not know how to proceed later:…
-
1
votes2
answers101
viewsEF relationship
I know it’s something basic, but how do I make a relationship between Entities using the Entity Framework? I have the Competition table and the Competition table. The Competition table must have an…
-
1
votes1
answer56
viewsInsert data with related objects
I’m trying to insert an object containing a relationship. User > Enterprise First I need to get the data from User in View of Create I’m doing it this way: public ActionResult Create() { var…
-
1
votes0
answers163
viewsMapping issues in Microsoft.Entityframeworkcore
I am trying to create in a class two Mappings Manytoone using the Entity Framework, but I’m not succeeding, if I take either of the two mappings and leave the other, it works but if I leave the two…
-
1
votes1
answer62
viewsAzure SQL database refusing connection
I’m having trouble connecting the Azure SQL database via a web application published at this address: http://timesheetacs.azurewebsites.net/Login/Login This is the connection string: <add…
-
1
votes1
answer292
viewsCode First Relationship Migration and Insert?
I’m using UserManager to manage users, I am using migration and I’m having relationship trouble. I happen to have the entity Cliente: public class Cliente : IdentityUser { [NotMapped] public string…
-
1
votes1
answer167
viewsDoubt with Join between two classes
I have the Classes: class Procedimento { public string CodProcedimento { get; set; } public string NomeProcedimento { get; set; } public string TpSexo { get; set; } public int IdadeMinima { get;…
-
1
votes1
answer970
viewsDoubt about how to implement a C# Dependency Injection using Ninject
I have a C# project with Windows Forms. I have a question about how to make an implementation between two layers of my application: Application and WindowsForms. I need to carry one DataGridView…
-
1
votes0
answers329
viewsMany-to-Many Relationship Entity Framework Code First Composite Primary Keys Repeat Column
in my application I have two entities with a relationship of many to many, namely, Activity and Skill: The EF (Code First) generates for me the junction table, but it is giving conflict if I create…
-
1
votes1
answer330
viewsAdd column to a table (foreign key) using Entity framework
I have a project in c# in a relatively advanced phase. My comic book already contains some test data. I am using code first Migrations from Entity Framework I have the Users and Images tables. The…
-
1
votes1
answer1244
viewsOptional Entity Framework include
I have a great deal of doubt here about Include of the Entity Framework. var ocorrencias = db.Ocorrencia .Include("Pessoa") .Where(c => c.Id > 1000).ToList(); I used the Include, because I…
-
1
votes0
answers130
viewsHow to use Subqueries with LINQ Entity Framework?
I need to write the following query in the Linq Entity Framework. I’m having difficulty in the subquery part, where I need to accumulate the quantity field. SELECT ppc.[PedidoCompraId] ,ppc.[EAN]…
-
1
votes2
answers276
viewsDropdownlist with Begincollectionitem
Goodnight! Could follow in this same question here, but it would be too long. As it may be another subject I decided to open another question. I got everything right as per the best answer, but…
-
1
votes3
answers7999
viewsUpdate Error with Entityframework
When I try to update an object in the database, I get the error, Store update, Insert, or delete statement affected an Unexpected number of Rows (0). Entities may have been modified or Deleted Since…
-
1
votes1
answer670
viewsFilter with Linq or Lambda using Join and Group By
Good Afternoon In a table where it is always inserted new records may occur of having the same Date and the same Ratecode, however I want to get a list of this table but for each Date group,…
-
1
votes1
answer151
viewsHow to register a user with Identity, with the data already entered?
I have a method that inserts several data from an excel spreadsheet into the database, but there are some data, such as email, password, or concurrencyStamp (set as NULL), so I can’t change users'…
-
1
votes1
answer276
viewsMany To Many Entity Framework Update
I’m having trouble at the time of updating with relationship Many to Many. I want the update method to update all itemEntity fields as well as vendors. For example I only put the description field…
-
1
votes1
answer55
viewsRelationship of Fluentapi Tables
I am trying to make a relationship of tables, using Fluentapi with Entity Framework, in which my purpose are 3 entities: public class Empresa { public Empresa() { this.Gerentes = new…
-
1
votes2
answers112
viewsStrange Behavior in Entityframework with Storedprocedure?
I’m conducting a search through StoredProcedures in the EntityFramework and the field of Data this presenting error conversion to type String. Method public IEnumerable…
-
1
votes2
answers185
viewsEntity Framework - rename Foreignkey
I have the classes: [Table("Editora")] public class Editora { [Key] public int EditoraID { get; set; } public string nome { get; set; } public List<Livro> livros { get; set; } public…
-
1
votes1
answer181
viewsInsert in 2 tables Entity framwork - 1 to 1
I have two entities generated by the code-first Wizard: Person [Table("pessoa")] public partial class pessoa { public pessoa() { pessoa_endereco = new HashSet<pessoa_endereco>(); }…
-
1
votes1
answer237
viewsFK error while running Migrations on C#
I have the following scenario public class branch() { public Branch() { Branchs = new HashSet<Branch>(); } [StringLength(80)] public string Description { get; set; } [Required]…
-
1
votes1
answer120
viewsError inserting data with Entrityframework C#
I have a very strange problem, I have 3 tables, being them, Countries, States and Cities, all of them are configured certainly equal, but it is giving error only when it is inserted data in the…
-
1
votes1
answer36
viewsError in constructor name parameter Objectparameter C#
When I pass a string variable to the Objetparameter parameter of the following error. string nomeParameter = sql.Substring(startPosition, stopPosition - startPosition); ObjectParameter parameter =…