Questions tagged as 'fluent-api'

3
answers

Entity Framework 4 - Error Migrations: The type ... is not defined in namespace namespace.Map (Alias = Self)

I have a problem with my application mappings. [EDITED] Follow the complete DataContext Class: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Data.Entity; using System.Data.Entity.Mo...
asked by 05.12.2016 / 03:09
1
answer

Replacement for Fluent API

I'm in a project of a system that uses C # language, using MVC, Entity Framework and I'm using the Fluent API. I wonder if you have any other way to do this. HasKey(oc => oc.OrdemCompraId); HasRequired(oc => oc.UsuarioCadastro) .With...
asked by 28.09.2015 / 18:50
1
answer

Error in running update-database migration

I'm trying to run the creation of my database, but I'm getting this error below and I'm not understanding why:    The type 'Client' can not be mapped as defined because it maps inherited properties from types that use entity splitting or anot...
asked by 24.02.2017 / 21:42
1
answer

Map relationships with Fluent API

I have three simple classes of city, state and country. I noticed that simply declaring a property of type Estado in class Cidade the foreign key is generated correctly. I would like to know how to do these mappings in the hand, I...
asked by 05.07.2016 / 15:44
1
answer

Data Annotation - error ratio 1: 1

I'm trying to make a 1 to 1 ratio. Apparently it would be something simple but my system is getting lost in this relationship; It does not make a mistake, but the relationship is wrong: Model: public class CieloRecorrencia { [Key...
asked by 04.04.2016 / 21:27
1
answer

Error inserting data with EntrityFramework C #

I have a very strange problem, I have 3 tables, being them, Countries, States and Cities, all of them are certainly configured the same, but it is giving error only when you enter data in the Cities table.    Classes: public class Paises :...
asked by 23.06.2017 / 01:16
1
answer

Table Relationship FluentAPI

I'm trying to make a table relationship, using FluentAPI with Entity Framework, in which my purpose are 3 entities: public class Empresa { public Empresa() { this.Gerentes = new HashSet<Gerente>(); } public int...
asked by 06.06.2017 / 17:03
1
answer

ASP.NET MVC How to Manipulate Table Users Using Code First

I am studying MVC ASP.NET code first . I am a beginner and I have a probably basic doubt. When you start a project, it already creates a basic application, including the User table. I happen to want to make a relationship between this User ta...
asked by 13.03.2017 / 09:47
1
answer

Fluent API Modeling with Reference Table

I would like to know how to perform the modeling of a particular entity, where its reference value belongs to another table. This reference value would be a domain table that has its ID's for credit cards, since my user can register that their s...
asked by 20.11.2016 / 00:09
0
answers

Error to map in EntityFramework

Good, I'm trying to map a database using the EntityFramework-Reverse-POCO-Code -First-Generator and one of my views has the following mapping: public VIEW_CODE_NAV_CustomerLedgerEntryMapping(string schema) { ToTable("VIEW_CODE_NAV_Cus...
asked by 06.12.2018 / 17:01