public List <Pet> GetPetByUserId(Guid Id) { return(_lunaPetShopContext.pets .AsNoTracking() .Where(PetQuery.GetAllByUserId(Id)) .ToList()); }
public void ShouldReturnSuccessWhenSendInvalidQuery() { var result = FakePetQuery.validQuery() .AsQueryable() .Where(PetQuery.GetAllByEmail("*****@*****.**")); Assert.AreEqual(0, result.Count()); }
public Pet GetPetById(Guid Id) { return(_lunaPetShopContext.pets .Include(x => x.User) .ThenInclude(u => u.Pets) .Where(PetQuery.GetPetbyId(Id)) .FirstOrDefault()); }
public List <Pet> GetAllByEmail(string Email) { return(_lunaPetShopContext.pets .AsNoTracking() .Include(p => p.User) .Where(PetQuery.GetAllByEmail(Email)) .ToList()); }
public PetController(PetQuery query, CreatePetCommandHandler create, DeletePetCommandHandler delete) { Query = query; CreateHandler = create; DeleteHandler = delete; }