private void SaveImgDetails(ImgProcessModel objDet) { DynamicParameters Parm = new DynamicParameters(); Parm.Add("@FileName", objDet.FileName); Parm.Add("@FileContent", objDet.FileContent); Parm.Add("@ImgClassification", objDet.ImgClassification); DbConnection(); con.Open(); con.Execute("AddImgDetails", Parm, commandType: System.Data.CommandType.StoredProcedure); con.Close(); }
public ActionResult DeleteImg(int id) { List <ImgProcessModel> ObjFiles = GetImgList(); var FileById = (from FC in ObjFiles where FC.Id.Equals(id) select new { FC.FileName, FC.FileContent, FC.ImgClassification }) .ToList().FirstOrDefault(); ImgProcessModel Fd = new ImgProcessModel(); Fd.FileName = FileById.FileName; Fd.FileContent = FileById.FileContent; Fd.ImgClassification = FileById.ImgClassification; DeleteImgDetails(Fd); return(RedirectToAction("ImgDetails")); }