zzz projects Entity Framework Core EF Core
Home Articles Knowledge Base Online Examples
  • Home
  • Articles
  • Knowledge Base
  • Online Examples

Entity Framework Core - Knowledge Base (KB)

10 results in tag: fluent

Duplicate navigation properties when using Entity Framework 6 and fluent api

I got two models with a relations....public class Customer { public Customer() { CustomerSites = new List<CustomerSite>(); } public IList<CustomerSite> CustomerSites { get; set; } } public class CustomerSite { public Gui...
c# entity-framework entity-framework-6 fluent foreign-keys
asked by ainteger

Entity Framework map struct/complex type without model properties

I have a 'model ...struct...' which is internally a string, but is being used to somewhat similiar to a ...GUID.......public struct Token { private string _value; private Token(Guid uuid) { _value = Token.FromGuid(uuid); } publi...
c# entity-framework entity-framework-6 fluent
asked by Acrotygma

Entity Framework 6 NotMapped attributes

Is there a way using the fluentAPI within a DbContext to manually include ICollections that have been [NotMapped] in the model? I know how to manually ignore properties using the fluentAPI ...modelBuilder.Entity<MyEntity>().Ignore(e => e.MyChildCollection...
ef-fluent-api entity-framework entity-framework-6 fluent
asked by Ted

Fluent API Table Scaffolding - HasBaseType

I have two entities in my project ...Student... and ...Teacher... which share a common base class, ...AccountModel.... The base class contains properties that are required by both students and teachers ...(semantically, both students and teachers are acco...
c# ef-fluent-api entity-framework entity-framework-core fluent
asked by Matthew Layton

EntityFramework Core Fluent Model Builder Key and Property

Ok so in entity framework 6 I would have had a key and property database generation in one statement:...modelBuilder.Entity<Function>() .HasKey(x => x.Id) .Property(x => x.Id) .HasDatabaseGeneratedOption(Dat...
c# entity-framework entity-framework-core fluent fluent-entity-framework
asked by lanky393

Adding unique identifier with Fluent API

I'm using a model which I have no control over, which I am saving instances of in a SQL database....I'm using Fluent API to add a primary key to an attribute in this model...modelBuilder.Entity<Message>().HasKey(d => d.DocumentId); ...Message... looks lik...
c# entity-framework-core fluent sql
asked by Khaine775

Get Value from other Table by ID with Entity Framework

i have two already existings tables (no foreignkey):...Customer (Id, Name, .....) Projects (Id, CustomerId, name)...And in my asp.net core application i have two model:...public class Customer { public int Id { get; set; }; public String Name { get;...
asp.net-core entity-framework-core fluent
asked by Ezak

Configure Backing Field of Different Type

private int _billAccount; public string BillAccount { get { var account = _billAccount.ToString().PadLeft(9, '0'); return account.Substring(0, 3) + "-" + account.Substring(3, 3) + "-" + account.S...
c# entity-framework-core fluent
asked by Wes H

SQL query to LINQ expression - Entity Core Framework 3 + SQL Server

DECLARE @thirtyDaysAgo DATETIME = getdate()-30 SELECT sum(case when CreatedWhen >= @thirtyDaysAgo then 1 else 0 end) lessThan30, sum(case when CreatedWhen < @thirtyDaysAgo then 1 else 0 end) Greaterthan30 FROM ThisAwesomeTable ...Cannot figure out how t...
entity-framework-core fluent linq sql-server
asked by Ashwin

How to map a DTO with a many-to-many relationship to a EF core entity with a relationship table using automapper?

I have two entities in my DB. A and B. I also have a relationship table representing a many to many relation between these entities AB:...public class A { public ICollection<AB> ABs { get; set; } } public class B { public ICollection<AB> ABs { ge...
asp.net-core automapper c# entity-framework-core fluent
asked by Ipsider

Page 1 of 1
  • 1

Prime Library

Performance

  • Entity Framework Extensions
  • Entity Framework Classic
  • Bulk Operations
  • Dapper Plus

Expression Evaluator

  • C# Eval Expression
  • SQL Eval Function
More Projects...

Related

  • EF Extensions Online Benchmark
  • WIN an EF Extensions license
  • EF6 BatchSaveChanges for only $79
Get monthly updates by subscribing to our newsletter!
SUBSCRIBE!