public JsonResult GetHeadlinesById(int Id) { DynamicParameters para = new DynamicParameters(); para.Add("@Id", Id); Task <DomainModel.Headline> list = _repo.GetFirstAsync("sp_HeadLines_GetbyId", CommandType.StoredProcedure, para); DomainModel.Headline pl = list.Result; return(Json(pl)); }
public JsonResult HeadLine_AddUpdate(DomainModel.Headline mod) { dynamic msg = string.Empty; try { DynamicParameters para = new DynamicParameters(); para.Add("@Id", mod.Id); para.Add("@HeadLine", mod.HeadLine); para.Add("@Description", mod.Description); _repo.AddAsync("sp_HeadLines_AddUpdate", CommandType.StoredProcedure, para); msg = "Success"; } catch (Exception ex) { msg = ex.Message; } return(Json(msg)); }