Created
August 9, 2019 20:48
-
-
Save joakimriedel/01c76933faff57d4e790d33c310a57ae to your computer and use it in GitHub Desktop.
Assert in SpillSequenceSpiller
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>netcoreapp2.2</TargetFramework> | |
<LangVersion>latest</LangVersion> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.6" /> | |
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="2.2.6" /> | |
</ItemGroup> | |
</Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.EntityFrameworkCore; | |
using System; | |
using System.Linq; | |
using System.Threading.Tasks; | |
namespace AssertRepro | |
{ | |
class Program | |
{ | |
static async Task Main(string[] args) | |
{ | |
using (var context = new ClientContext()) | |
{ | |
var matches = await context.BillingGroups | |
.Select(bg => new MatchDto() | |
{ | |
BillingGroup = bg | |
}) | |
.ToListAsync(); | |
} | |
} | |
public class BillingGroup | |
{ | |
public int Id { get; set; } | |
} | |
public class MatchDto | |
{ | |
public BillingGroup BillingGroup { get; set; } | |
} | |
class ClientContext : DbContext | |
{ | |
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) | |
{ | |
optionsBuilder.UseInMemoryDatabase(Guid.NewGuid().ToString()); | |
} | |
protected override void OnModelCreating(ModelBuilder builder) | |
{ | |
base.OnModelCreating(builder); | |
} | |
public DbSet<BillingGroup> BillingGroups { get; set; } | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment