Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Created April 8, 2026 16:41
Show Gist options
  • Select an option

  • Save dcomartin/3cd802a2e3fc7b5f19c9b84779d38052 to your computer and use it in GitHub Desktop.

Select an option

Save dcomartin/3cd802a2e3fc7b5f19c9b84779d38052 to your computer and use it in GitHub Desktop.
public class FulfillOrder
{
private readonly DbContext _dbContext;
public FulfillOrder(DbContext dbContext)
{
_dbContext = dbContext;
}
public async Task Handle(int orderId)
{
var order = await _dbContext.Orders.FindAsync(orderId);
order.Status = OrderStatus.Fulfilled;
await _dbContext.SaveChangesAsync();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment