Skip to content

Instantly share code, notes, and snippets.

View dario-l's full-sized avatar
🎯
Hardly working

Dariusz Lenartowicz dario-l

🎯
Hardly working
View GitHub Profile
@dario-l
dario-l / gist:7fe437f9101c6962828ab4905d853fe4
Created May 28, 2025 15:08
OwnsOne and ComplexProperty mixed mapping results in projecting all columns from data table
// See https://aka.ms/new-console-template for more information
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
var serviceCollection = new ServiceCollection();
serviceCollection.AddDbContext<DatabaseContext>(c => c.UseSqlite("Data Source=:memory:"));
var serviceProvider = serviceCollection.BuildServiceProvider();
var dbContext = serviceProvider.GetService<DatabaseContext>();