public async Task <IActionResult> GetAll(int userId, int eventId) { var allGifts = await _repo.GetAll(userId, eventId); if (allGifts == null) { return(BadRequest()); } var giftToRetrunDTOs = _mapper.Map <ICollection <GiftToRetrunDTO> >(allGifts); return(Ok(giftToRetrunDTOs)); }
public void getGiftByBrandId() { List <Gift> list = _gift.GetAll().ToList <Gift>(); List <Gift> listGetByBrandId = new List <Gift>(); foreach (Gift gift in list) { if (gift.BrandId.Equals(HttpContext.Session.GetString("brandId")) && gift.Status != 1) { listGetByBrandId.Add(gift); } } ViewBag.listGifts = listGetByBrandId; ViewBag.email = HttpContext.Session.GetString("email"); }
public async Task <List <Gift> > GetAll() { return(await _giftDal.GetAll()); }
public IActionResult GetAll() { var gifts = _giftRepository.GetAll(); return(Ok(gifts)); }