diff --git a/docs/introduction.md b/docs/introduction.md index bd18b91..3828562 100644 --- a/docs/introduction.md +++ b/docs/introduction.md @@ -81,14 +81,9 @@ TypedRest uses an object-oriented approach to provide you with building blocks f === "C#" ```csharp - class MyClient : EntryEndpoint + class MyClient(Uri uri) : EntryEndpoint(uri) { - public MyClient(Uri uri) - : base(uri) - {} - - public ICollectionEndpoint Contacts - => new CollectionEndpoint(this, relativeUri: "./contacts"); + public CollectionEndpoint Contacts => new(this, relativeUri: "./contacts"); } ``` @@ -146,30 +141,16 @@ Of course, we don't expect our predefined patterns to cover all possible use cas === "C#" ```csharp - class MyClient : EntryEndpoint + class MyClient(Uri uri) : EntryEndpoint(uri) { - public MyClient(Uri uri) : base(uri) - {} - - public ContactCollectionEndpoint Contacts - => new ContactCollectionEndpoint(this); + public ContactCollectionEndpoint Contacts => new(this); } - class ContactCollectionEndpoint : CollectionEndpoint - { - public ContactCollectionEndpoint(IEndpoint referrer) - : base(referrer, relativeUri: "./contacts") - {} - } + class ContactCollectionEndpoint(IEndpoint referrer) : CollectionEndpoint(referrer, relativeUri: "./contacts"); - class ContactEndpoint : ElementEndpoint + class ContactEndpoint(IEndpoint referrer, Uri relativeUri) : ElementEndpoint(referrer, relativeUri) { - public ContactEndpoint(IEndpoint referrer, Uri relativeUri) - : base(referrer, relativeUri) - {} - - public IElementEndpoint Note - => new ElementEndpoint(this, relativeUri: "./note"); + public ElementEndpoint Note => new(this, relativeUri: "./note"); } ```