Top "Ef-fluent-api" questions

A way to configure Entity Framework beyond its conventions with a method chaining API

Violation of primary key Entity Framework Code First

I have started with C# and I wanted to make my own DB. I have two models public class AModel { …

c# entity-framework ef-fluent-api
Set EF6 Code First strings fluently to nvarchar(max)

I'm building an EF6 code first model using the fluent API. My understanding is, by default, strings will be nvarchar(…

c# entity-framework ef-code-first ef-fluent-api
Set a constraint for minimum int value

I am using the Repository pattern. I have a entity called Product and I want to set the minimum value …

c# entity-framework ef-code-first ef-fluent-api
One-to-One relationships in Entity Framework 7 Code First

How to configure One-to-One or ZeroOrOne-to-One relationships in Entity Framework 7 Code First using Data Annotations or Fluent Api?

entity-framework ef-code-first entity-framework-core ef-fluent-api
One to one relationship with Entity Framework Fluent API

I'm having trouble with reverse navigation on one of my entities. I have the following two objects: public class Candidate { […

c# entity-framework ef-code-first ef-fluent-api
One or Zero to One Entity Framework Code First FluentApi

I need to create fluentapi one or zero to one reference and have navigation properties on both of entities. EntityTwo …

c# entity-framework ef-code-first ef-fluent-api
Use IEntityTypeConfiguration with a base entity

In EF Core 2.0, we have the ability to derive from IEntityTypeConfiguration for cleaner Fluent API mappings (source). How can I …

c# asp.net-core entity-framework-core ef-fluent-api ef-core-2.0
Entity Framework Core 2.0: How to configure abstract base class once

I have a base model: public abstract class Status { public string updateUserName { get; set; } } Then a model which extends the …

sql-server ef-code-first entity-framework-core asp.net-core-2.0 ef-fluent-api
Optional One-to-many Relationship in Entity Framework

I'm having issues getting an optional one-to-many relationship to work. My model is: public class Person { public int Identifier { get; …

c# entity-framework entity-framework-6 ef-fluent-api
Moving from EF6 to EF Core 2.0

I just started moving my MVC5 project with EF6x to MVC Core and EF Core but have a big …

c# entity-framework-core ef-fluent-api ef-core-2.0