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
-
0
votes0
answers51
viewsTransaction with Entity Framework. Saves 2 times after error
I am using transaction to make changes to the bank. My problem is when there is an error in saving time. If there is error at the time of inserting the drive it treats the correct way not saving…
-
0
votes0
answers97
viewsRecords in Icollection<> navigation property are not being recorded
I’m trying to make an inclusion of items in a list property but I’m not able to include the records in the database. First I have the following class models: public class Frota { public Frota() {…
c# asp.net-mvc entity-framework entity-framework-6 asp.net-mvc-4asked 8 years, 11 months ago JamesTK 901 -
0
votes2
answers146
viewsContext trying to delete the same record twice
I’m having a problem, actually it must be the same lack of knowledge, at the time of deleting a record using Entity Framework 6. When I try to delete a record that cannot be deleted because it has…
-
0
votes0
answers167
viewsFirebird error with Entity Framework and C#
I’m trying to use Firebird with Entity Framework in C#, but when I create relationships and try to give Update-Database in Migration gives this error: Type is not resolved for member…
-
0
votes1
answer242
viewsError using EF6 Codefirst with Mysql
I have the following error when running Migrations: How can I fix it? I have everything installed. Follow me Web.Config: <connectionStrings> <add name="ProjetoCultContext"…
-
0
votes2
answers88
viewsAction Edit in Viewmodel
Well, I’m trying to implement the action of editing the data of a viewmodel that I own in my project. I even put together an action, but it’s not working... What happens is that what I researched,…
-
0
votes2
answers1186
viewsEntity Framework: Object Update Error
I am unable to update my object. I created the method as follows: public void Atualizar(T obj) { banco.Entry(obj).State = EntityState.Modified; banco.SaveChanges(); } The following exception was…
-
0
votes0
answers158
viewsInstantiate Unit of Work with only 1 context. EF 6 Simple Injector
In a simple application, I have the code below that works up to a certain point, very well. However, for each Service that is instantiated to the Form, a new working unit is created, consequently a…
-
0
votes1
answer202
viewsError rendering Partialview in a View
I have a View and within it I want to render a Partialview. What happens is that the partial is of a model different but that has relationship between them. I want to show a partial as if it were…
-
0
votes1
answer209
viewsEntityframework 6: Doubt to Persist a Relationship N to N
Model: public class Agenda { public int Id { set; get; } public string Horario { set; get; } public string Local { set; get; } public virtual IEnumerable<Exame> Exames { set; get; } } public…
-
0
votes1
answer344
viewsError while editing Viewmodel data
In project I have a Viewmodel and inside it my models and everything. What happens is that I am trying to edit the data that is already saved in the database. I can bring the edited data from the…
-
0
votes1
answer88
viewsPublishing system with Entity Framework 6
There is an executable installer for Entity Framework 6 for servers. I posted the system to a Windows server 2008, and it’s not working. Is returning the following error: Schema specified is not…
-
0
votes1
answer218
viewsConnection String not found WPF Entity Framework
I am in a WPF project using some MVVM practices, I am using Entity Framework database first and the Connection string is already in the app.config, I have already followed all the procedures I have…
-
0
votes0
answers70
viewsEntity Framework 6: Error saving - Instances of Ientitychangetracker
Domain public class Agenda { public int Id { get; set; } public DateTime Data { get; set; } public string HoraInicial { get; set; } public string HoraFinal { get; set; } public string Local { get;…
-
0
votes1
answer692
viewsUpdate Object List via Entity Framework
Good morning! I wanted to ask for your help just to see if there’s a better way to do it. Today I have a list of objects like Formatacao_RelatorioLinhaDeletada and perform a foreach on this list,…
-
0
votes0
answers60
viewsHow to make a screen in Asp.net MVC, which lists the ID’s of the same table
Well I have little programming experience so I need help with that. I have a table called Person, and a table to create the relationship between herself that is called Personal, relationship 1 for…
-
0
votes0
answers262
viewsMysql with Entity Framework Code First
I have a project where I need to use Mysql as a database and EF6 with the CODE FIRST approach. I installed Mysql.Data.Entity 6.9.9 and Entityframework 6.1.3 My app.config looks like this:…
-
0
votes2
answers98
viewsEF6: Error while Saving
I have the following scenario that I’m in trouble: Category: public class Categoria { public int Id { get; set; } public string Descricao { get; set; } public virtual ICollection<Produto>…
-
0
votes1
answer224
viewsError updating Record with EF
I’m having a hard time updating a record, using Ef. Relationship key conflict error. As if I’ve been trying to add and not update. Additional information: A referential Integrity Constraint…
-
0
votes1
answer565
viewsWorking with view in context in Entity Framework 6
It’s all right, guys? I have a certain problem I’d like you to help me. Good I have a simple application with 4 related tables I am using Entity framework 6, my problem is in the USUARIOS class,…
-
0
votes1
answer30
viewsrecord does not update with EF
I have a bit of a problem, on the screen, I change the value of the field, and when saved, it does not generate the error, and also does not save. The flow follows, as if there were no problem that…
-
0
votes2
answers160
viewsIcollection<Object> - how to create and use objects within the collection
I am working on a project using MVC5 and Entityframwork 6. I followed a tutorial to create a database from my templates. Example of a model: public class Side { public Side() { } public int ID {…
-
0
votes1
answer63
viewsVariable interfering with value of other variable
Good afternoon Gentlemen. I’m facing a problem I’ve never seen before, below I have a view mapped in the EF with effluent var viewRelatorio = db.view.where(ra.DataBruta.Month ==…
-
0
votes1
answer179
viewsAssociative Table of Companies and Users, Many to Many
I am starting my studies in ASP.NET and I have a certain difficulty to make a link between 2 tables of the type Many to Many. Next I have 2 tables: Company and User, so that a company can own…
-
0
votes1
answer283
viewsValidate Business Rule
I’m using this sample tutorial Data repository to create a layered crud with Entity Framework with Code First. My question would be how to validate a business rule where a user with already existing…
-
0
votes1
answer47
viewsHow to implement w3c bandwidth requests?
The video plays right. However I can’t skip the video time. Example: Skip time from 05:00 to 10:00. It just keeps spinning, and I can’t skip time. I searched on the internet and they say you have to…
html5 asp.net-mvc-5 entity-framework-6 html5-videoasked 7 years, 8 months ago Matheus Miranda 5,375 -
0
votes1
answer75
viewsEF 6 - Migrations does not reflect changes in entities
I changed my entities and I turned the command Update-Database -Verbose -Script only to see in SQL what changes would be made. Generated the legal script with all changes. I closed the script window…
-
0
votes1
answer46
viewsMapping 1 to 0, 0 to 1
I need to create a map between two existing entities, where both are independent. So. I have an entity DepositoTransferencia and the other is Conta. The idea is that at a given time, the entity…
-
0
votes0
answers101
viewsHow to create composite key and ensure the same property in 2 model
I have 3 model public class UnidadeNegocio { public int Id { get; set; } public string Nome { get; set; } } public class Cliente { public int Id { get; set; } public int UnidadeNegocioId { get; set;…
-
0
votes1
answer1012
viewsEntityframework: There is no mapping of the Objectparameter object type to a native type managed provider
I am developing an MVC application with Entity Framework in Code First. As my database has procedures, I opted to use Sqlquery to execute the procedures, but I am thinking about this error: Não…
-
0
votes1
answer122
viewsError trying to save information to the database via Entity Framework
My project has the following classes: public class Manifestacao { public long Id { get; set; } public string NumeroChamado { get; set; } public virtual Cliente Cliente { get; set; } public virtual…
-
0
votes1
answer57
viewsWhy does the one-to-many relationship in the Entity Framework by default not work?
[Table(name: "cliente", Schema = "estudo")] public class Cliente : Base { [Key, Column("COD_CLIENTE")] [Required] public override Int64 Id { get; set; } [Column("CLI_NOME")] [Required] public…
-
0
votes0
answers136
viewsdbContext static with Entity Framework: Compensates or not?
Guys, I use Entity Framework and Code First to manage my data access, and I’m thinking of working with a single instance, static and global of my Databasecontext. But I have two questions: What…
-
0
votes1
answer88
viewsEntity Framework 6: Context Management Problem
I have the object Agenda and create it as follows: public class Program { public static void Main(string[] args) { var clienteDAO = new ClienteDAO(); var treinoDAO = new TreinoDAO(); var agendaDAO =…
-
0
votes1
answer145
viewsEntity Framework. Select only 1 from a list in Include?
I’m only trying to get a 1 record of the Phones and Emails lists. var lista = Db.Oportunidades .Include(x => x.Conta.Proprietario) .Include(x => x.Conta.Contatos.Select(c => c.Telefones))…
-
0
votes0
answers94
viewsEntity Framework (Database first) - Include Dataannotations
I saw in an MS link that it is possible to create a partial class and a Metadata class to include Dataannotations in properties created by the Entity Framework (database first). Well, I did as it is…
-
0
votes1
answer443
viewsUsing SQL Query with Asp MVC5
how do I execute an SQL query with ASP MVC5 + Entity? Example, I need to use "Count" in a table called "templates" am dev php and am learning now Asp.net framework mvc 5 and have no idea how to do…
-
0
votes1
answer42
viewsEntity Framework bank creation
I’m new to Entity and I’m following a step by step to create a Code First application ( http://www.entityframeworktutorial.net/code-first/simple-code-first-example.aspx ). I created the application,…
-
0
votes0
answers53
viewsEF - A Member of the type, 'X', does not have a corresponding column in the data Reader with the same name
Good, I am using Entityframework to pass the result of this query: SELECT a.* FROM [Logística$Sales Invoice Header] AS a INNER JOIN [Logística$Sales Invoice Line] AS b ON a.No_ = b.[Document No_]…
-
0
votes2
answers655
viewsCall the controller via javascript or ajax and insert in table Asp.net mvc
How can I get an item from ul li pass its value(id) to my controller and insert that value into the table? I already have the list this chunk of code below already works I can add items in the list…
javascript jquery asp.net-mvc ajax entity-framework-6asked 6 years, 10 months ago Cesar Augusto 341 -
0
votes1
answer1126
viewsError accessing data in Mysql with EF6
When I try to access data in Mysql via lambda(EF), Visual Studio returns the following error: Falha no método >'MySql.Data.Entity.EFMySqlCommand.set_DbConnection(System.Data.Common.DbConnection)'…
-
0
votes1
answer102
viewsMVC5 + Entity Framework + Form + Modal
I have an application where there is a central entity and several other auxiliary registers, such as Status, Format, Type, etc. All these auxiliary entities have only 2 fields: Name and Status…
-
0
votes1
answer90
viewsError Entity Framework WPF Client
I installed my application in client environment but am getting the following error: Nome do Evento de Problema: CLR20r3 Assinatura do Problema 01: eLogBook.exe Assinatura do Problema 02: 1.0.0.0…
-
0
votes0
answers41
viewsDropdownlist Asp.net mvc
I have a product that can be registered in 2 stores A and B if I have already registered in A how do pro Dropdownlist show me only show option B next time it is in register? what would be the logic?…
-
0
votes1
answer71
viewsGenerating model from database - table with an attribute and Inheritance
In the project I am working I have the following doubts: First, I made some inheritance tables in the database where each has only one column id(which is pk and fk of the table to which they…
entity-framework-6asked 6 years, 8 months ago Guilherme Caixeta 87 -
0
votes2
answers55
viewsProblem saving data to database
I created a simple application, but when clicking on the action button responsible for saving the data, the program stops working. Follow picture: Save button action:- private void…
-
0
votes2
answers132
viewsHow to change EF6 to create Datetime fields as datetime2
I am working with **EF6 Code-first", SQL-Server database. I came across the following error, when saving an object with Datetime property. The Conversion of a datetime2 data type to a datetime data…
-
0
votes1
answer254
viewsChange only edited columns
In an application I am developing, when trying to update only the fields that were changed the Entity Framework is also changing the fields that do not need. Repository code: public void Update(T…
asp.net-mvc entity-framework asp.net-mvc-5 entity-framework-6asked 6 years, 5 months ago Matheus Daumas 37 -
0
votes1
answer164
viewsError when deleting record with Entity Framework when mapping entity
When I try to delete a record from the Mapper (Model to Domain) have the following error as return from E.F: failed because Another Entity of the same type already has the same Primary key value.…
-
0
votes1
answer215
views(Localdb) Error after Update-Database command -> "Cannot attach the file ...."
I am trying to use Sql Serve Localdb in an application with Entity Framework and Migrations, but when I give the Update-Database command, the following error occurs: Cannot attach the file 'C:…
c# .net entity-framework entity-framework-6 migrationsasked 6 years, 3 months ago Márcio Sebastião 769