protected override async System.Threading.Tasks.Task OnReceived(IRequest request, string connectionId, string data) { var t = _demoService.Add(2); var s = _addressRepository.Find(1, 1); await Connection.Send(connectionId, data); }
// 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()); }
public JsonResult Add(Demo entity) { ModelState.Remove("ID"); ModelState.Remove("CreatedTime"); ModelState.Remove("UpdatedTime"); ModelState.Remove("IsDelete"); if (ModelState.IsValid) { entity.CreatedTime = entity.UpdatedTime = DateTime.Now; return(JResult(IDemoService.Add(entity))); } else { return(ParamsErrorJResult(ModelState)); } }
public int Action3(int a, int b, [FromServices] IDemoService theService) { return(theService.Add(a, b)); }
public int Add(int a, int b) { return(_service.Add(a, b)); }