Skip to content

Instantly share code, notes, and snippets.

View smitpatel's full-sized avatar
🌴
Snail Pace

Smit Patel smitpatel

🌴
Snail Pace
View GitHub Profile
@smitpatel
smitpatel / MultiLevelIncludeQueries.cs
Last active October 15, 2021 17:39
This app shows how to do split queries for multiple levels of collection include in EF Core 3.0
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.EntityFrameworkCore;
namespace EFSampleApp
{
public class Program
{
public static void Main(string[] args)
@smitpatel
smitpatel / IncludeOverloads.cs
Created June 9, 2017 17:50
New include overloads to support including navigations using lambda on derived types while querying base type
public static class EntityFrameworkQuerybleExtensions
{
#region Current
public static IIncludableQueryable<TEntity, TProperty> Include<TEntity, TProperty>(
this IQueryable<TEntity> source,
Expression<Func<TEntity, TProperty>> navigationPropertyPath)
where TEntity : class
{
return default(IIncludableQueryable<TEntity, TProperty>);