Questions tagged as 'entity-framework-6'

1
answer

Entity Framework 6, many X many relationship and Scaffolding

I am doing a college project and my knowledge in ASP.Net is not very deep. In my project I came across a MxM relationship and I can not implement this situation in a useful way. The relationship is as follows: A company registers one or m...
asked by 15.04.2017 / 23:38
0
answers

Error cast on return of Entity Framework 6 [closed]

I have two entities that inherit from the same abstract class. public class Empresa : PessoaJuridica { private Empresa() { } public Empresa(string CNPJ, string RazaoSocial, Status Situacao, byte MaxNumeroUsuarios) {...
asked by 08.03.2017 / 22:33
0
answers

Automapper error in relationship

I have the following classes: public class ListaGrupo : EntidadeBase { public ListaGrupo() { Items = new List<ListaGrupoItem>(); } public int Id { get; set; } public string Nome { get; set; } public virtu...
asked by 13.10.2016 / 21:26
1
answer

Upload information _Layout.cshtml database welcome

I want to load the information in _Layout.cshtml as registered in the database, for example, @ViewBag.MetaDescription , @ViewBag.MetaKeywords , @ViewBag.Title and other information also coming from the database. What...
asked by 04.05.2016 / 22:01
0
answers

What is EntityFramework and how to use it with C # and connection to PostgreeSql and MySql databases?

I am programming a CRUD of students in ADO with C # and MySql, my algorithm teacher told me about Entity, but I can not find anything clear to make the connection between the banks. Someone explain to me?     
asked by 06.06.2016 / 17:30
1
answer

ENTITY FRAMEWORK - add-migration New Project without renaming old tables

I want to share a database with some projects. I've already done the first project with the bank and it's ok. I copied the project to create a similar one, changed the initial prefix of the Ex tables: project1_client, project2_client and so t...
asked by 30.03.2016 / 20:57
2
answers

Best way to retrieve data for a Datagridview?

What is the best way to retrieve data from a table directly to a DataGridView? I have a lot of doubts, because a lot of people do not recommend using UnitOfWork, which makes it much easier and makes the code much cleaner. var unitOfWork...
asked by 10.03.2016 / 21:04
0
answers

Npgsql - Problem with Entity Framework 6

I'm having trouble using PostgreSQL with Entity Framework 6. When trying to fetch the data from my repository I get the following message:    The context can not be used while the model is being created. This   exception may be thrown if t...
asked by 24.01.2016 / 02:45
1
answer

Decimal value with 5 decimal places in sql server

I am developing a (Asp.NET MVC 5.2.3.0, EF 6.1.3 e SQL Server 2012) application, the database has a table with the decimal(6, 5) field, when saving a value in this -2,56478 field, for example in the database it is -2,5600...
asked by 22.02.2016 / 21:04
1
answer

EF6 and NPGSQL: Foreign key violation error

Good afternoon! I'm new to ASP.NET and EF6. Developed earlier in PHP. I created a project (ASP.NET MVC) using EF6 and NPGSQL. I picked up a little while creating the relationships between two tables but it worked. The persona table will have...
asked by 05.10.2015 / 22:58