Skip to content

Instantly share code, notes, and snippets.

@gistlyn
Last active June 30, 2021 07:13
Show Gist options
  • Save gistlyn/26231f929d4852b105758bd94676341b to your computer and use it in GitHub Desktop.
Save gistlyn/26231f929d4852b105758bd94676341b to your computer and use it in GitHub Desktop.
api-design
var client = new JsonServiceClient(baseUrl);
List<Contact> response = client.Get(new GetContacts());
public class Contact
{
public int Id { get; set; }
public string Name { get; set; }
}
[Route("/contacts")]
public class GetContacts : IReturn<List<Contact>> { }
public class ContactsService : Service
{
public object Any(GetContacts request) =>
Db.Select<Contact>();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment