public User GetUserById(Guid Id)
        {
            ValidationException.Requires(Id != Guid.Empty, "Invalid Id");

            var IdAsString = Id.ToString();

            return(_userRepository.GetAll().Where(x => x.Id == IdAsString).FirstOrDefault());
        }
Esempio n. 2
0
 public virtual T GetById(Guid Id)
 {
     ValidationException.Requires(Id != Guid.Empty, "Invalid Id");
     return(_repository.GetAll().FirstOrDefault(x => x.Id == Id));
 }
 public Task <T> GetByIdAsync(Guid Id)
 {
     ValidationException.Requires(Id != Guid.Empty, "Invalid Id");
     return(_repository.FirstOrDefaultAsync(_repository.GetAll().Where(x => x.Id == Id)));
 }
 public Task <T> GetByIdAsync(Guid id, CancellationToken cancellationToken = default)
 {
     ValidationException.Requires(id != Guid.Empty, "Invalid Id");
     return(_repository.FirstOrDefaultAsync(_repository.GetAll().Where(x => x.Id == id)));
 }