-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(users): add user entities and repository
- Loading branch information
1 parent
2e02eb6
commit 481e1ba
Showing
3 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using Microsoft.AspNetCore.Identity; | ||
|
||
namespace Armory.Users.Domain | ||
{ | ||
public class ArmoryRole : IdentityRole | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using Microsoft.AspNetCore.Identity; | ||
|
||
namespace Armory.Users.Domain | ||
{ | ||
public sealed class ArmoryUser : IdentityUser | ||
{ | ||
public ArmoryUser(string username, string email, string phone) | ||
{ | ||
UserName = username; | ||
Email = email; | ||
PhoneNumber = phone; | ||
} | ||
|
||
private ArmoryUser() | ||
{ | ||
} | ||
|
||
public static ArmoryUser Create(string username, string email, string phone) | ||
{ | ||
var user = new ArmoryUser(username, email, phone); | ||
|
||
return user; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Identity; | ||
|
||
namespace Armory.Users.Domain | ||
{ | ||
public interface IArmoryUserRepository | ||
{ | ||
Task<IdentityResult> Save(ArmoryUser user, string password); | ||
} | ||
} |