Mega_New_Presence/Demo/Data/Repository/UserRepositoryImpl.cs
2024-11-04 23:16:00 +03:00

38 lines
889 B
C#

using Demo.Data.Exceptions;
using Demo.Data.LocalData;
using Demo.Data.RemoteData.RemoteDataBase.DAO;
using Demo.domain.Models;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Demo.Data.Repository
{
public class UserRepositoryImpl
{
private List<UserLocalEnity> _users;
public UserRepositoryImpl()
{
_users = LocalStaticData.users;
}
public IEnumerable<UserLocalEnity> GetAllUsers => _users;
public bool RemoveUserById(Guid UserGuid)
{
var user = _users.FirstOrDefault(u => u.Guid == UserGuid);
if (user == null) throw new UserNotFoundException(UserGuid);
_users.Remove(user);
return true;
}
public UserDao? UpdateUser(UserDao user)
{
throw new NotImplementedException();
}
}
}