Skip to content

Instantly share code, notes, and snippets.

🌴
Snail Pace

Smit Patel smitpatel

🌴
Snail Pace
View GitHub Profile
@smitpatel
smitpatel / MultiLevelIncludeQueries.cs
Last active Jul 20, 2020
This app shows how to do split queries for multiple levels of collection include in EF Core 3.0
View MultiLevelIncludeQueries.cs
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 / .editorconfig
Created Jul 10, 2018
EditorConfig file
View .editorconfig
# Schema: http://EditorConfig.org
# Docs: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
# top-most EditorConfig file
root = true
# Don't use tabs for indentation.
[*]
indent_style = space
trim_trailing_whitespace = true
@smitpatel
smitpatel / Repro11887.cs
Created May 4, 2018
Repro code for Issue 11887
View Repro11887.cs
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
namespace EFSampleApp
{
@smitpatel
smitpatel / Repro11860.cs
Created Apr 30, 2018
Repro code for EFCore issue 11860
View Repro11860.cs
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.Extensions.Logging;
namespace EFSampleApp
{
public class Program
@smitpatel
smitpatel / Repro11835.cs
Created Apr 27, 2018
Repro code for issue 11835
View Repro11835.cs
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
namespace EFSampleApp
{
@smitpatel
smitpatel / QueryFilter.cs
Created Apr 4, 2018
QueryFilter works as expected
View QueryFilter.cs
using System;
using System.Linq;
using System.Linq.Expressions;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.Extensions.Logging;
namespace EFSampleApp
{
public class Program
@smitpatel
smitpatel / Repro.cs
Created Mar 30, 2018
Sample repro code issue 11438
View Repro.cs
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
namespace EFSampleApp
{
@smitpatel
smitpatel / IncludeOverloads.cs
Created Jun 9, 2017
New include overloads to support including navigations using lambda on derived types while querying base type
View IncludeOverloads.cs
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>);
View Data.sql
CREATE PROCEDURE [dbo].[Enterprise_Delete]
(
@Id uniqueidentifier
)
AS
BEGIN
SET NOCOUNT ON
DECLARE @ErrorNumber INTEGER -- the error code.
DECLARE @ErrorMessage NVARCHAR(100) -- error message to return
@smitpatel
smitpatel / Repro6499.cs
Created Sep 15, 2016
Repro code for EF issue 6499
View Repro6499.cs
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.Extensions.DependencyInjection;
using System.Linq;
namespace ModelApp
{
public class Program
You can’t perform that action at this time.