Esempio n. 1
0
    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());
    }
Esempio n. 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());
        }
Esempio n. 3
0
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="ids"></param>
 /// <returns></returns>
 public ActionResult Delete(string ids)
 {
     return(JResult(IDemoService.Delete(ids)));
 }