Open ErikEJ opened 4 years ago
@eebeeDEV Interesting shortcut.
I wonder if I could take advantage of that in my SqlQuery library/NuGet package?
Hi Erik. I have been using this approach with EFCore 3, but with EFCore 6 new migrations are generating a Table
for the ReturnValue<T>
:
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ReturnValue<int>",
columns: table => new
{
Value = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
});
}
Any idea how to prevent this?
Ah, I missed the bit about ToView(null)
modelBuilder.Entity<ReturnValue<int>>().HasNoKey().ToView(null);
Can i make this asynchronous?
Sure just use FirstAsync
Hi,
One can use generics in the class definition:
when building the model, create a builder for each type one will need:
and then to execute:
This makes it more versatile
Best, E.