ASP.NET Core REST Toolkit - a pattern library for rapidly creating clean REST APIs in ASP.NET Core
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
RestToolkit
.gitattributes
.gitignore
LICENSE
README.md
RestToolkit.sln

README.md

RestToolkit

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

Example AdditionalUserInfo code

public class ExampleAccountController 
	: AccountController<IExampleAdditionalUserInfo, ExampleUser, ExampleAdditionalUserInfo>
{
	//ctor...
}

public interface IExampleAdditionalUserInfo : IToolkitAdditionalUserInfo<ExampleUser>
{
    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;
    }
}