Beispiel #1
0
        public async Task <JsonResult> DeleteAsync(int id)
        {
            try
            {
                BrandModel model = new BrandModel(_unitOfWork);
                await model.DeleteAsync(id);

                logger.Debug("Brand deleted successfully.");
                return(Json(new { result = true }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                logger.Error("Error while invoking Delete action method: ", ex);
                return(Json(new { result = false, error = ex.Message }, JsonRequestBehavior.AllowGet));
            }
        }