using System.Diagnostics.CodeAnalysis; using DotBased.ASP.Auth.Domains.Auth; using DotBased.ASP.Auth.Domains.Identity; namespace DotBased.ASP.Auth; /// /// In memory data provider, for testing only! /// [SuppressMessage("ReSharper", "CollectionNeverUpdated.Local")] public class MemoryAuthDataRepository : IAuthDataRepository { private readonly List _userList = []; private readonly List _groupList = []; private readonly List _authenticationStateList = []; public async Task CreateUserAsync(UserModel user) { if (_userList.Any(x => x.Id == user.Id || x.Email == user.Email)) return Result.Failed("User already exists."); _userList.Add(user); return Result.Ok(); } public async Task UpdateUserAsync(UserModel user) { if (_userList.All(x => x.Id != user.Id)) return Result.Failed("User does not exist!"); return Result.Ok(); } public Task DeleteUserAsync(UserModel user) { throw new NotImplementedException(); } public Task> GetUserAsync(string id, string email, string username) { throw new NotImplementedException(); } public Task> GetUsersAsync(int start = 0, int amount = 30, string search = "") { throw new NotImplementedException(); } public Task CreateGroupAsync(GroupModel group) { throw new NotImplementedException(); } public Task UpdateGroupAsync(GroupModel group) { throw new NotImplementedException(); } public Task DeleteGroupAsync(GroupModel group) { throw new NotImplementedException(); } public Task> GetGroupAsync(string id) { throw new NotImplementedException(); } public Task> GetGroupsAsync(int start = 0, int amount = 30, string search = "") { throw new NotImplementedException(); } public Task CreateAuthenticationStateAsync(AuthenticationStateModel authenticationState) { throw new NotImplementedException(); } public Task UpdateAuthenticationStateAsync(AuthenticationStateModel authenticationState) { throw new NotImplementedException(); } public Task DeleteAuthenticationStateAsync(AuthenticationStateModel authenticationState) { throw new NotImplementedException(); } public Task> GetAuthenticationStateAsync(string id) { throw new NotImplementedException(); } }