An open API service indexing awesome lists of open source software.

https://github.com/biarity/resttoolkit

ASP.NET Core REST Toolkit - a pattern library for rapidly creating clean REST APIs in ASP.NET Core
https://github.com/biarity/resttoolkit

asp-net-core asp-net-core-api asp-net-core-web-api aspnetcore aspnetcoreapi aspnetcorewebapi

Last synced: 5 months ago
JSON representation

ASP.NET Core REST Toolkit - a pattern library for rapidly creating clean REST APIs in ASP.NET Core

Awesome Lists containing this project

README

          

# RestToolkit
ASP.NET Core REST Toolkit - for quickly creating clean REST APIs in ASP.NET Core

# Example `AdditionalUserInfo` code

```C#
public class ExampleAccountController
: AccountController
{
//ctor...
}

public interface IExampleAdditionalUserInfo : IToolkitAdditionalUserInfo
{
string UserName { get; set; }
}

[DataContract]
public class ExampleUser : ToolkitUser, IExampleAdditionalUserInfo
{
public void Map(ref ExampleUser user)
{
throw new System.NotImplementedException();
}
}

public class ExampleAdditionalUserInfo : IExampleAdditionalUserInfo
{
[Required]
[MinLength(3), MaxLength(10)]
[RegularExpression("[A-Za-z0-9]+")]
[PersonalData]
public string UserName { get; set; }

public void Map(ref ExampleUser user)
{
user.UserName = UserName;
}
}
```