Sources

DV DEV Community: #aspnetcore
RSS

17stories
1 d agolatest
Messaging
Messaging
DVDEV Community: #aspnetcore Anas Amin 2 d ago

Sending leads to Odoo without losing one: a transactional outbox in ASP.NET Core

Saving a lead and then calling Odoo means two writes that can each fail on their own. Anas Amin describes a transactional outbox where the lead and a message describing it commit together, and a Hangfire job delivers the message later. Leased claims, error classification, dead-lettering and idempotent Odoo writes carry the rest of the design.

ASP.NET Core 10
Stop double charges
DVDEV Community: #aspnetcore Zohaib Ahmad 6 d ago

Designing out double charges and overselling in an ASP.NET Core POS

A write-up on Tilly POS, a multi-branch point-of-sale built with ASP.NET Core 10, EF Core and SQL Server, explains how three costly failures were designed out: double charges, half-written sales and overselling. The fixes are practical: idempotency keys backed by a unique index, one transaction per sale, and a single conditional UPDATE for stock. Useful for any .NET service that moves money or inventory.

ASP.NET Core
Body can't be read twice
DVDEV Community: #aspnetcore Sukhpinder Singh 6 d ago

Reading the request body in middleware leaves handlers with an empty body

Reading the request body in logging middleware can leave the endpoint handler and model binding with an empty body. The author reproduces the problem with a 61-byte JSON POST and shows how EnableBuffering plus a position reset fixes it. A pitfall every ASP.NET Core developer who logs payloads should know.

GraphQL.NET
Flexible data queries
DVDEV Community: #aspnetcore Lincoln Zocateli Oct 26

GraphQL for Beginners: A .NET 10 Guide with GraphQL.NET

This beginner guide explains GraphQL schemas, queries, mutations and resolvers and builds a working endpoint with GraphQL.NET on ASP.NET Core and .NET 10. It compares the same product read with a REST endpoint and shows how validation errors come back as HTTP 200 with an errors array. Useful for .NET teams weighing GraphQL, especially the server-side duties it adds.

ASP.NET Core
Test 404 without a server
DVDEV Community: #aspnetcore Sukhpinder Singh Oct 25

Test Minimal API 404 branches without booting a server

The author shows how to test the 404 branch of a minimal API endpoint by calling the handler directly instead of booting WebApplicationFactory. Typed result unions such as Results<Ok<T>, NotFound> make the return type a compiler-checked contract. The approach gives fast, readable unit tests, while the author keeps a thin layer of integration tests for routing, binding and middleware.

ASP.NET Core 10
Refuse bad requests well
DVDEV Community: #aspnetcore MICHAEL-MAURICE Oct 24

Six Requests a Minimal API Should Refuse, and Their Status Codes

How should a warehouse order API refuse illegal state changes, short stock, stale ETag writes and malformed JSON? The author builds a pick-pack-ship demo on .NET 10 Minimal APIs and EF Core 10, mapping each refusal to a specific status code, such as 409, 412 and 400. He also explains why an exact retry should return 200 instead of an error. A useful guide for anyone designing workflow endpoints.

ASP.NET Core 10
Fix common API mistakes
DVDEV Community: #aspnetcore Pankaj Singh Oct 23

Six common ASP.NET Core Web API mistakes and the patterns to use instead

A developer who has maintained ASP.NET Core APIs for years lists six recurring problems: scattered try/catch blocks, unbounded list queries, ignored cancellation tokens, lost UTC kinds, late config failures and unprotected login endpoints. Each comes with a suggested pattern using .NET 10 and EF Core 10, noted to work on .NET 8 with small changes.

ASP.NET Core 10
Wrong page from cache
DVDEV Community: #aspnetcore Sukhpinder Singh Oct 22

SetVaryByQuery Can Make ASP.NET Core Output Cache Serve Wrong Pages

The article explains how calling SetVaryByQuery in an ASP.NET Core output cache policy replaces the default vary-by-all-query-keys behavior. A policy that names only sort stops varying by page, so different pages can receive the same cached body. The author reproduces the bug with a small test and shows the fix.

Feedback

Found a bug or have an idea? Your message lands straight in my inbox.

Type of message