public async Task <IActionResult> PutByNumber(int key, [FromBody] PropertyMachine uPropertyMachine) { uPropertyMachine.ModifyDate = DateTime.Now; uPropertyMachine.Modifyer = uPropertyMachine.Modifyer ?? "Someone"; return(new JsonResult(await this.repository.UpdateAsync(uPropertyMachine, key), this.DefaultJsonSettings)); }
public async Task <IActionResult> Post([FromBody] PropertyMachine nPropertyMachine) { nPropertyMachine.CreateDate = DateTime.Now; nPropertyMachine.Creator = nPropertyMachine.Creator ?? "Someone"; return(new JsonResult(await this.repository.AddAsync(nPropertyMachine), this.DefaultJsonSettings)); }