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);
        }
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
 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));
     }
 }
Esempio n. 4
0
 public int Action3(int a, int b, [FromServices] IDemoService theService)
 {
     return(theService.Add(a, b));
 }
Esempio n. 5
0
 public int Add(int a, int b)
 {
     return(_service.Add(a, b));
 }