/// <summary> /// Add_News /// </summary> /// <param name="request">Add_NewsRequest</param> /// <returns></returns> public async Task <bool> Add_News(Add_NewsRequest request) { bool result = false; try { var param = new AddNewsParameter() { NameNews = request.NameNews, IDCreater = request.IDCreater, Date = DateTime.Now, ImageNews = request.ImageNews, ImageNewDetail = request.ImageNewDetail, ViewMax = request.ViewMax, DescriptionNews = request.DescriptionNews, }; _dataAccess.Add_News(param); result = true; return(result); } catch (Exception ex) { result = false; return(result); } return(await Task.FromResult(result)); }
public IHttpActionResult AddNews(Add_NewsRequest RequestData) { var result = _businessLogic.Add_News(RequestData); return(new ActionResult <bool>(result.Result, Request)); }