Skip to content

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

License

Notifications You must be signed in to change notification settings

Biarity/RestToolkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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;
    }
}

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages