How to create your own Fluent API in C#
Why Stack Overflow recommends it
Stack Overflow users link it when answering questions about method chaining, pipelines and builder-style APIs in C#.
Recommended by 3 people across 3 different months, 2021 to 2022.
What it is
Nick Chapsas walks through building a fluent API in C# and .NET using a staged builder approach. He shows how interfaces can guide callers through the methods in a required order. The video is a short coding tutorial with source code available to Patreon supporters.
What people said
Recommends Olivier Jacot-Descombes · 2021-08 · Stack Overflow · on “Need better design at forming c# object for an API rquest”
I just saw this tutorial video from Nick Chapsas yesterday. It explains How to create your own Fluent API in C# [this video] (YouTube).
Recommends Jason · 2021-10 · Stack Overflow · on “How to implement a simple workflow pipeline fluent api method chaining?”
I know this is an old question, but this is a pretty recent video explaining how to build a nice Fluent API. One thing mentioned, that I think is great, is the idea of using interfaces to enforce the correct order to call the APIs. [this video]
Recommends Doc · 2022-05 · Stack Overflow · on “Does .NET 6 support pipelines of business logic - like middleware for a request, but for custom logic?”
A delegate sequence builder might do the trick. Check out this blog: [LINK] Here's a good walkthrough of the builder pattern: [this video] .