IAccountManager.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // ======================================
  2. // Author: Ebenezer Monney
  3. // Email: info@ebenmonney.com
  4. // Copyright (c) 2017 www.ebenmonney.com
  5. //
  6. // ==> Gun4Hire: contact@ebenmonney.com
  7. // ======================================
  8. using DAL.Models;
  9. using System;
  10. using System.Collections.Generic;
  11. using System.Linq;
  12. using System.Text;
  13. using System.Threading.Tasks;
  14. namespace DAL.Core.Interfaces
  15. {
  16. public interface IAccountManager
  17. {
  18. Task<bool> CheckPasswordAsync(ApplicationUser user, string password);
  19. Task<Tuple<bool, string[]>> CreateRoleAsync(ApplicationRole role, IEnumerable<string> claims);
  20. Task<Tuple<bool, string[]>> CreateUserAsync(ApplicationUser user, IEnumerable<string> roles, string password);
  21. Task<Tuple<bool, string[]>> DeleteRoleAsync(ApplicationRole role);
  22. Task<Tuple<bool, string[]>> DeleteRoleAsync(string roleName);
  23. Task<Tuple<bool, string[]>> DeleteUserAsync(ApplicationUser user);
  24. Task<Tuple<bool, string[]>> DeleteUserAsync(string userId);
  25. Task<ApplicationRole> GetRoleByIdAsync(string roleId);
  26. Task<ApplicationRole> GetRoleByNameAsync(string roleName);
  27. Task<ApplicationRole> GetRoleLoadRelatedAsync(string roleName);
  28. Task<List<ApplicationRole>> GetRolesLoadRelatedAsync(int page, int pageSize);
  29. Task<Tuple<ApplicationUser, string[]>> GetUserAndRolesAsync(string userId);
  30. Task<ApplicationUser> GetUserByEmailAsync(string email);
  31. Task<ApplicationUser> GetUserByIdAsync(string userId);
  32. Task<ApplicationUser> GetUserByUserNameAsync(string userName);
  33. Task<IList<string>> GetUserRolesAsync(ApplicationUser user);
  34. Task<List<Tuple<ApplicationUser, string[]>>> GetUsersAndRolesAsync(int page, int pageSize);
  35. Task<Tuple<bool, string[]>> ResetPasswordAsync(ApplicationUser user, string newPassword);
  36. Task<bool> TestCanDeleteRoleAsync(string roleId);
  37. bool TestCanDeleteUserAsync(string userId);
  38. Task<Tuple<bool, string[]>> UpdatePasswordAsync(ApplicationUser user, string currentPassword, string newPassword);
  39. Task<Tuple<bool, string[]>> UpdateRoleAsync(ApplicationRole role, IEnumerable<string> claims);
  40. Task<Tuple<bool, string[]>> UpdateUserAsync(ApplicationUser user);
  41. Task<Tuple<bool, string[]>> UpdateUserAsync(ApplicationUser user, IEnumerable<string> roles);
  42. }
  43. }