public async Task <IActionResult> Delete(int id)
    {
        var controller = typeof(DemoController).Name;

        _logger.LogInformation($"Delete method on {controller} started");

        await _demoService.Delete(id);

        _logger.LogInformation($"Delete method on {controller} finished successfully");

        return(Ok());
    }
Exemple #2
0
        // GET: Demo
        public ActionResult Index()
        {
            var id = demoSerivce.Add(new Model.DemoModel()
            {
                Demo = "Add"
            });
            var model = demoSerivce.GetById(id);

            model.Demo = "Update";
            demoSerivce.Update(model);
            demoSerivce.Delete(id);
            return(View());
        }
Exemple #3
0
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="ids"></param>
 /// <returns></returns>
 public ActionResult Delete(string ids)
 {
     return(JResult(IDemoService.Delete(ids)));
 }