Skip to content

Latest commit

 

History

History
35 lines (26 loc) · 1.09 KB

File metadata and controls

35 lines (26 loc) · 1.09 KB

type-IncludeProperties

Uselful for fullstack developer using Front TypeScript and .NET.

This goal is typed Include Method for EF Core via DTO.

Docs links:

ObjectQuery.Include(String) Method

Usage Notes

export interface EntityA {
    PropertyPrimitve1: number;
    PropertyPrimitve2: Date;
    PropertyPrimitve3?: TimeSpan;
    EntityB?: EntityB;
}


export interface EntityB {
    PropertyPrimitve1: number;
    PropertyPrimitve2: Date;
    PropertyPrimitve3?: TimeSpan;
    EntityC: EntityC;
}

export interface EntityC {
    PropertyPrimitve1: number;
    PropertyPrimitve2: Date;
    PropertyPrimitve3?: TimeSpan;
}

type IncludeResult = IncludeProperties<EntityA>;
// "EntityB" | "EntityB.EntityC"