Questions tagged as 'entity-framework-6'

1
answer

Property containing only the KeyAttribute attribute resulting in a self-incrementing column in the database

If I'm not mistaken, this must have come in version 6.1.1 of EntityFramework and it was not like that in previous versions. I believe that a column only became auto-increment when the DatabaseGenerated attribute was declared with the...
asked by 13.10.2014 / 21:53
2
answers

Error 4 The type 'System.Data.Entity.DbContext' is defined in an assembly that is not referenced

I have already looked for several solutions to this error on the internet and unfortunately nothing helped me. Can anyone help me with how to resolve this error ??    Error 4 The type 'System.Data.Entity.DbContext' is defined in an   assem...
asked by 16.10.2014 / 17:27
0
answers

How to avoid database locking using EntityFramework Transaction

I have a method where I save several classes and call another method to do an optimization on top of these classes, however I am using Transaction , in case something wrong in this optimization I need to give rollback . Transaction...
asked by 10.11.2018 / 20:43
0
answers

How to use interfaces like DbSet's in the Entity Framework in C #

Hello, I'm doing a solution where my entire business layer is in a separate project and in this project I created the relational layer structure from interfaces as shown in the example below: // interfaces de definição de características publ...
asked by 17.10.2018 / 14:14
0
answers

Error updating MySQL.Data

I made the update of MySQL.Data and MySQL.Data.Entity from version 6.9.9 to version 6.10.4 and started to get the error below:    Inheritance security rules were violated by type: 'MySql.Data.MySqlClient.MySqlProviderServices'. Derived types...
asked by 07.11.2017 / 15:43
2
answers

Dynamic Connection EF C # Windows Forms Mysql

I have the following problem: EF creates a connectionString in the app.config of the application and always uses that connection, but in case you need to change the server of the bank I will have to change the app.config. I have tried a wa...
asked by 11.03.2016 / 23:27
2
answers

Error When Adding Controller in ASP.NET MVC

Good morning, I'm making a small solution using ASP.NET MVC with Entity Framework 6 to attend a work from my course. I created the context class: namespace WillianRibeiro.EstudandoMVC.Web.Data{ public class EstudandoMVCContext : DbContext {...
asked by 10.08.2017 / 16:42
1
answer

ASP.Net MVC application with Jquery Bootgrid does not load data

I created a very simple application (client registry) using ASP.Net MVC 5 + Entityframework 6 (codefirst) + MySql database. Using the JQuery Bootgrid component for data manipulation as the main component. It happens that locally applicati...
asked by 04.07.2017 / 14:46
3
answers

Select in entity framework with certain columns

I'm trying to make a select in a table that contains several columns and I want the sql the EntityFramework generate contains only the columns that I have specified. My code looks like this: var clientes = (from cliente in reposit...
asked by 08.09.2014 / 15:04
2
answers

Fluent API and Migration

I have the following scenario: public abstract class Pessoa { /* Propriedades do Pessoa*/ public Guid IdPessoa { get; set; } } public class Cliente : Pessoa { public Cliente() { IdPessoa = Guid.NewGuid(); Endereco...
asked by 21.01.2016 / 22:35