Exemplo n.º 1
0
        public async Task <ActionResult> Delete(string id)
        {
            var model = await modelService.GetModelByIdAsync(id);

            if (model != null)
            {
                try
                {
                    modelService.Delete(model.ModelID);
                    return(Json(true, JsonRequestBehavior.AllowGet));
                }
                catch (Exception ex)
                {
                    throw new Exception(ex.Message);
                }
            }
            return(Json(false, JsonRequestBehavior.AllowGet));
        }