C#C
C#3y ago
Dusty

✅ Refit / RestLess API SDK Structure

Hey!

How do I structure an SDK for my API?

Let's say I have 2 resources: Users and Groups.

I could use Refit or RestLess to create an interface which wraps the CRUD operations on both resources.

However if I add more resources (which I do have) to the interface it gets messy.

Is there a way to structure my API SDK like this?
public interface IMyApi
{
    public IMyUsersApi Users { get; }
    public IMyGroupsApi Groups { get; }
}

Where IMyUsersApi and IMyGroupsApi would contain all CRUD operations for their resource.
Was this page helpful?