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
- Host: GitHub
- URL: https://github.com/biarity/resttoolkit
- Owner: Biarity
- License: mit
- Created: 2018-06-25T07:15:39.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-11-20T05:15:20.000Z (over 7 years ago)
- Last Synced: 2025-01-13T16:25:38.172Z (about 1 year ago)
- Topics: asp-net-core, asp-net-core-api, asp-net-core-web-api, aspnetcore, aspnetcoreapi, aspnetcorewebapi
- Language: C#
- Homepage:
- Size: 61.5 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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;
}
}
```