public List <ClothesTrackingDto> GetByUserGuidId(long userGuidId, ClothesTrackingEnum clotheStatus) { var user = UserService.GetByGuid(userGuidId); var result = ((IClothesTrackingRepository)Repository).GetDeepByUserId(user.Id, clotheStatus); return(AutoMapper.Mapper.Map <List <ClothesTrackingDto> >(result)); }
public List <ClothesTracking> GetDeepByUserId(long userId, ClothesTrackingEnum clotheStatus) { var result = Context.ClothesTrackings.Where(p => p.OrderClothes.UserId == userId && (int)p.Action == (int)clotheStatus) .Include(p => p.OrderClothes.User) .Include(p => p.OrderClothes.ClotheType); return(result.ToList()); }
public async Task <IHttpActionResult> GetClothesByUserId(ClothesTrackingEnum clotheStatus) { try { var result = ClothesTrackingService.GetByUserGuidId(userGuidId, clotheStatus); return(Ok(result)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }