Most voted "entity-framework-6" questions
It is a set of ADO . NET technologies that supports data-driven application development.
Learn more…371 questions
Sort by count of
-
1
votes1
answer325
viewsEntity Framework 6 - Migrations - Add c column/ default value and name Constraint
I want to add a column like BIT to an existing table with a default value 1 via Migrations. The challenge is...we have in the company a standard for the name of constraints and it is not legal the…
-
1
votes1
answer499
viewsIt cannot be assigned as it is read-only after doing a "Join"
Controller: [HttpPost] public ActionResult Listar_Json() { var id = 5; var search = Request["search[value]"]; //Aqui pega valor digitado no input, digamos que ele digitou 100.000,01 var query =…
-
1
votes0
answers130
viewsBulk insert with Entity Framework 6
I have a project where the user selects a txt or csv file, and the system reads line by line passing the fields to an entity. The first time, he executed SaveChanges() from the bank context to each…
entity-framework-6asked 7 years, 5 months ago Guilherme Camarotto 153 -
1
votes3
answers160
viewsProblem mapping entities related to Fluent API
I am starting with EF and I am having problems to map the relationship between my entities. 1. Entities There are two entities in the project that I am using to practice the subject. They are: User…
-
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
votes2
answers61
viewsStatic class system settings in the Entity Framework
I am trying to create settings for a system. I thought of a class similar to the example: Class: public static class Configuracoes { [DisplayName("Casas Decimais")] [Description("Informa o número de…
-
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
answer156
viewsDuplicate data on datagrid
I am developing an application in WPF and when I fill the datagrid via code it returns the duplicate value. I am using Entity Framework. XAML <DataGrid x:Name="dataLocal" Margin="10,111,11,10"…
-
1
votes1
answer1690
viewsMysql net Connector and Entity Framework problem
When I install the mysql connector in version 6.9.11, I can see the driver for ADO.Net, so far so good. But when I try to create the template I get the following error: Now when I install the 6.10.6…
-
1
votes1
answer114
viewsHow to Save Data Console Application using Entityframework
I made a console application using the Entity Framework, I’m just having a hard time implementing the methods of my repository class that I inherit from an interface,: public interface…
-
1
votes1
answer165
viewsHow to use Include for objects that are inside a list
I have the following objects in my EF6 context. public class Produto { public Guid Id {get;set;} public string Nome {get;set;} } public class VedaItem { public int Item {get;set;} public float Valor…
-
1
votes0
answers28
viewsHow to solve the Stackoverflow exception that occurs in the Entity Map for the Model?
In my application a Team has several users and a User belongs to only one Team (1:N), so I have the following entities: public class Equipe{ public Guid EquipeId {get; set;} public string Nome {get;…
-
1
votes1
answer874
viewsUnit Tests in Controller mocking EF Context
I’m not getting a solution on how to test my application (mocking the EF context) EF context: public class SawluxContexto : DbContext { public DbSet<Restaurante> Restaurante { get; set; }…
-
1
votes2
answers65
viewsWhen placing a class in Dbset using Migrations
I have the following classes: public DbSet<Request> Requests { get; set; } public DbSet<Answer> Answers { get; set; } where they have a one-to-Many relationship. When I want a class to…
-
1
votes0
answers36
viewsIs it possible to make a related Entity possible to display with Odata Expand (Webapi)?
Hello, I have a question regarding the following situation: I have an Entity that I defined in my model as Tasfafreq public partial class TarefaFreq { [Key] public int ID { get; set; } public string…
-
1
votes1
answer82
viewsRelationship 1x1(or not)
I have 2 entities: Itempedido and Product... Using the Fluent API as I say to my Itempedido entity that she has a Product? Note: The product entity cannot have dependencies, although 1 product can…
c# entity-framework entity-framework-6 relationshipasked 6 years, 3 months ago Márcio Sebastião 769 -
1
votes1
answer47
viewsOrderly list return at BLL?
In my project I use the EF6, use generic repositories and in my layer BLL I have the class ClienteBLL, which is a class that has the logical implementation methods of the class. In one of the…
-
1
votes0
answers115
viewsJumping id 1000 Sql server 2014 (localDB)
In my application a few times when I will add some data to the database the ID jumps in 1000 drives. I found some solutions, but they are not good for me because I use EF6 with code-first and my…
-
1
votes1
answer119
viewsProblem in FK name size
I have a WebApi to work with a Firebird 2.5, I used the EF at the time, but today I am presenting the following error "The name 'FK_ARRUMACAO_CHECKLIST_ARRUMACAO_ARRUMACAO_ID' is longer than…
c# entity-framework entity-framework-6 firebirdasked 6 years, 2 months ago Lucas Riechelmann Ramos 521 -
1
votes0
answers36
viewsCode-based configuration - EF6
I’ve been trying for a few days to implement a connection to an Oracle 11g database using the EF6 code-based configuration, but nothing I’ve done so far seems to work. Currently this is my…
-
1
votes0
answers56
viewsError to map in Entityframework
Good, I’m trying to map a database using Entityframework-Reverse-POCO-Code-First-Generator and one of my views has the following mapping: public VIEW_CODE_NAV_CustomerLedgerEntryMapping(string…
-
1
votes1
answer85
viewsJoin C# EF6 lambda Expression
I’m having a problem, I’m doing a Join with C# with EF6, I have two unrelated tables Invest and Encarteiramento and need to make a Join in Invest where agency and account is equal to, agency and…
-
1
votes1
answer32
viewsCode First Generating a foreign key
I have the following classes public class ControleDeVisitas { public virtual ICollection<TipoDeSistemas> TipoDeSistemas { get; set; } } public class TipoDeSistemas { public Guid…
-
1
votes1
answer56
viewsOne-To-One relationship with EF?
I’m trying to create a relationship OneToOne with EF6. In my scheme I have a User class and a Plan and the relationship would be 1 User has 1 Plan, however, this relationship is done when the User…
-
1
votes2
answers37
viewsEntity Framework -> How to find the largest table elements
I have the following tables in my base: Produto Id | Nome | Preco 1 | fone | 100 2 | copo | 50 3 | pao | 10 ProdutoStatus IdProduto | Versao | Preco 1 | 1 | 101 1 | 2 | 110 1 | 3 | 90 2 | 1 | 55 2 |…
sql-server .net entity-framework asp.net-core entity-framework-6asked 3 years, 9 months ago Guilherme Golfetto 743 -
1
votes0
answers18
viewsError connecting to Entity Framework in an existing BD
I created an application that uses Entity Framework 6X and Code First mode by Fluent API, Map Classes, using classes from my model , and creating the context class. When I try to connect to see if…
-
1
votes1
answer38
viewsSelect String attribute using Split and LINQ?
I have the following string "1,2,3,4,5,6,7,8,9,10," that I want to make a Split in a Select to search in the database if the number 9 is inserted in a field that receives strings of numbers. I want…
-
0
votes1
answer851
viewsUpdating edmx file is not working
Whenever I do: UPDATE MODEL FROM DATABASE on top of my edmx file, it does everything right, including shows the table to be updated or the fields. It doesn’t make any mistakes, it acts as if…
-
0
votes1
answer58
viewsSave information from tabs
I have my canvas, as follows: each tab corresponds to a class, and database entity, and going in sequence there is a reference to them, ie na 02 tem referencia(fk) da 01, na 03 tem referencia(fk) 02…
-
0
votes1
answer388
viewsCreate registration pattern with C# UI repository
I created in my system a repository with EF6, each registration I do access the methods of my repository to commit the actions I need (Insert, Delete etc...). The problem is that my system is very…
-
0
votes1
answer317
viewsExpression does not work in Include in Entity Framework
I tried to make the following expression var listag = db.grupo.Include(x => x.Itens).ToList(); It doesn’t work that way, but if I pass that way: db.grupo.Include("Itens").ToList();, So it works,…
entity-framework-6asked 10 years, 3 months ago Rod 9,412 -
0
votes1
answer278
viewsPlace where methods of interaction of CRUD with the bank in ASP.NET MVC should be
I am using the Entity framework and developing a system through ASP.NET MVC5 but I was in doubt about CRUD. The methods of interaction with the database (Create,Update,Select,Delete) should be…
-
0
votes2
answers87
viewsAdd new Controller
When adding a new Controller in my project using the option MVC 5 Controller with views, using Entity Framework I’m having the error there was an error running the selected code generator, according…
-
0
votes1
answer112
viewsError display foreign key attribute
I have my classes: public class Bandeira { public int BandeiraID { get; set; } public string Nome { get; set; } public virtual ICollection<Curso> Cursos { get; set; } } public class Curso {…
-
0
votes0
answers66
viewsConnection between Entity Framework and Sybase 12
People trying to make a connection with visual studio 2015, using C# and using the Entity Framework and Sybase 12, I’ve turned to the internet and I can’t find a solution if anyone knows anything…
-
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
answer201
viewsASP.NET Form MVC 5 cannot access Model properties
I am starting at ASP.NET MVC, following tutorials and handouts on the internet I created a study project and I have some doubts. Well, first I’ll create a class structure to follow: > Acesso…
-
0
votes1
answer90
viewsAnnotation to create Index Unique that accepts null with EF Code First
I want to create the following Index in a table by annotation: CREATE UNIQUE NONCLUSTERED INDEX idx_yourcolumn_notnull ON YourTable(yourcolumn) WHERE yourcolumn IS NOT NULL; SQL source above. The…
entity-framework-6asked 8 years, 3 months ago Ricardo 5,680 -
0
votes1
answer157
viewsUsing Multiple Schemas with Entity Framework 6
I am starting to work with the Entity Framework, and I need some example of how I can define for my tables the Schema’s that each one is contained. My database was created as in the example:…
-
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
answer114
viewsMethod finishes its execution unexpectedly when calling another method
I am implementing a method that performs a call to another method that should return one IEnumerable<TEntidade>. However, when returning from this list the method that started the call simply…
-
0
votes1
answer492
viewsComposite key with EF Fluentapi
I’m having trouble defining a relationship with composite key in Fluentapi. I have the following entities: Product, Personal, and Stock. I need in stock table I have a product FK (Produtoid) and a…
-
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
votes0
answers470
viewsEntity Framework 6: Connection Error
I created a project with Entity Framework 6 and another Console Application type project, containing the following connection string in the App.Config file: <connectionStrings> <add…
-
0
votes2
answers158
viewsHow do I correct this error, and was able to see this other table in my view?
I need to make a select with two tables and play the result for a PagedList. But when I query, returns the error: Cannot implicitly Convert type 'Pagedlist.Ipagedlist' to…
-
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
votes1
answer303
viewsdatetime vs dateime2, which is the best?
I’m implementing a new project, using EF6 Codefirst, EF6 creates my database Sql-Server, with date columns as type datetime. What would be the difference between datetime and datetime2, and which is…
-
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
votes0
answers84
viewsError message when creating new Controller with Entity Framework
I’m new to the ASP.NET MVC and I’m having a problem. When I try to add a new Controller using Entity Framework gives an error saying: error when running the selected code generator: value -1 is out…
-
0
votes0
answers60
viewsQuestions with navigation and FK properties with Code First
Why in this code was identified as foreign key the Idgroup property and not the navigation property and what would be the correct form of the foreign key application? public class Grupo { public…