Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

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

About

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

Topics

Resources

License

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.