示例#1
0
 public List <Pet> GetPetByUserId(Guid Id)
 {
     return(_lunaPetShopContext.pets
            .AsNoTracking()
            .Where(PetQuery.GetAllByUserId(Id))
            .ToList());
 }
示例#2
0
        public void ShouldReturnSuccessWhenSendInvalidQuery()
        {
            var result = FakePetQuery.validQuery()
                         .AsQueryable()
                         .Where(PetQuery.GetAllByEmail("*****@*****.**"));

            Assert.AreEqual(0, result.Count());
        }
示例#3
0
 public Pet GetPetById(Guid Id)
 {
     return(_lunaPetShopContext.pets
            .Include(x => x.User)
            .ThenInclude(u => u.Pets)
            .Where(PetQuery.GetPetbyId(Id))
            .FirstOrDefault());
 }
示例#4
0
 public List <Pet> GetAllByEmail(string Email)
 {
     return(_lunaPetShopContext.pets
            .AsNoTracking()
            .Include(p => p.User)
            .Where(PetQuery.GetAllByEmail(Email))
            .ToList());
 }
示例#5
0
 public PetController(PetQuery query, CreatePetCommandHandler create, DeletePetCommandHandler delete)
 {
     Query         = query;
     CreateHandler = create;
     DeleteHandler = delete;
 }