Skip to content

Instantly share code, notes, and snippets.

View andoband's full-sized avatar

Andy Heimdahl andoband

  • Pilot Mound, MN
View GitHub Profile
@davidfowl
davidfowl / MinimalAPIs.md
Last active June 28, 2024 17:42
Minimal APIs at a glance
@davidfowl
davidfowl / DTO.cs
Last active June 2, 2023 09:16
Associated types: A demo of what DTOs could look like as a language feature
using System.ComponentModel.DataAnnotations;
using Microsoft.EntityFrameworkCore;
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.MapPost("/todos", async (CreateTodo createTodo, TodoDb db) =>
{
// This is where the implicit conversion comes in
db.Todos.Add(createTodo);