示例#1
0
        public async Task <IActionResult> getWish(int id)
        {
            var wish = await _wishRepo.GetWish(id);

            if (wish != null)
            {
                return(Ok(wish));
            }
            return(BadRequest("Problem with getting user wish"));
        }
示例#2
0
        public async Task <IHttpActionResult> Get(IdModel id)
        {
            if (id == null)
            {
                return(ErrorApiResult(300, "Не передан id.Либо левый формат"));
            }
            var result = await _wishRepository.GetWish((long)id.Id);

            if (result == default(WishDto))
            {
                return(ErrorApiResult(300, "Не найден"));
            }
            return(SuccessApiResult(result));
        }