PlayerService.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. using System.Linq.Expressions;
  2. using DataLayer.Interfaces;
  3. using Domain;
  4. using Services.Interfaces;
  5. namespace Services;
  6. public class PlayerService : IPlayerService
  7. {
  8. private readonly IAbstractRepository<Player> _playerRepository;
  9. public PlayerService(IPlayerRepository playerRepository)
  10. {
  11. _playerRepository = playerRepository;
  12. }
  13. public Task Add(Player entity)
  14. {
  15. throw new NotImplementedException();
  16. }
  17. public Task<int> CountAll()
  18. {
  19. throw new NotImplementedException();
  20. }
  21. public Task<int> CountWhere(Expression<Func<Player, bool>> predicate)
  22. {
  23. throw new NotImplementedException();
  24. }
  25. public Task<Player> FirstOrDefault(Expression<Func<Player, bool>> predicate)
  26. {
  27. throw new NotImplementedException();
  28. }
  29. public async Task<IEnumerable<Player>> GetAll()
  30. {
  31. try
  32. {
  33. var players = await _playerRepository.GetAll();
  34. return players;
  35. }
  36. catch (Exception e)
  37. {
  38. throw;
  39. }
  40. }
  41. public async Task<Player> GetById(int id)
  42. {
  43. return await _playerRepository.GetById(id);
  44. }
  45. public Task<IEnumerable<Player>> GetWhere(Expression<Func<Player, bool>> predicate)
  46. {
  47. throw new NotImplementedException();
  48. }
  49. public Task Remove(Player entity)
  50. {
  51. throw new NotImplementedException();
  52. }
  53. public Task Update(Player entity)
  54. {
  55. throw new NotImplementedException();
  56. }
  57. }