Questions tagged as 'entity-framework-6'

1
answer

Validate Business Rule

I am using this example tutorial Data Repositories to create a layered crud with the Entity Framework with Code First. My question would be how to validate a business rule where a user with login already exists in the database can not be re...
asked by 05.04.2017 / 04:07
1
answer

EF FluentAPI compound key

I'm having trouble defining a compound key relationship in FluentAPI. I have the following entities: Product, Private Person and Stock. I need in the stock table I have a Product FK (ProductID) and a PersonFilial (FilialID) FK so that it is not...
asked by 02.04.2017 / 13:07
1
answer

Associative Table of Companies and Users, Many for Many

I'm starting my studies in ASP.NET and I'm having a hard time making a link between 2 tables of the Many to Many type. Next I have 2 tables: Company and User, so that a company can have multiple users and at the same time a user can belong to...
asked by 04.03.2017 / 14:55
1
answer

Error inserting monetary value into bank

I'm trying to save the value 137421.20 in a SqlServer table with a field of type Numeric (8.2). But I get an error with the description: "Parameter value 137421.20 is out of range." I'm trying to enter the value in the FileTracker_Total...
asked by 21.02.2017 / 21:43
1
answer

record does not update with EF

I have a rather annoying problem on the screen, I change the value of the field, and when saved, does not generate the error, and also does not save. The flow follows, as if there were no problems this object is so clientes.endereco I imple...
asked by 22.11.2016 / 02:11
0
answers

MySQL 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: <configSections> <section name="entityFr...
asked by 28.10.2016 / 12:28
1
answer

Connection String not found WPF Entity Framework

I'm in a WPF project using some MVVM practices, I'm using the Entity Framework database first and the connection string is already in the app.config, I've already followed all the procedures I've read on several issues but in the view this messa...
asked by 14.07.2016 / 14:27
0
answers

Instantiate Unit of Work with only 1 context. EF 6 Simple Injector

In a simple application, I have the code below that works to some extent, very well. However, for each Service that is instantiated for the Form, a new unit of work is created, consequently a new Context. So while the user is working on form, he...
asked by 13.06.2016 / 03:09
0
answers

How to make a screen in ASP.NET MVC, which relates the ID's of a same table

Well, I have little programming experience so I need help with this. I have a table named Person , and a table to create the relationship between itself PersonParceiro , relationship 1 to several. that is, the Person of Tbl PersonParceir...
asked by 17.10.2016 / 23:28
1
answer

Error rendering PartialView in a View

I have a View and inside it I want to render a PartialView . What happens is that the partial is of a different model , but that has a relationship between them. I want to show a partial as if it were index , where I show everyth...
asked by 19.06.2016 / 00:55