Beispiel #1
0
 public async Task <IActionResult> Create([FromBody] ManagerVM managerVM)
 {
     try
     {
         Manager m = managerVM.ToModel();
         return(this.Ok(await managerAPI.Add(m)));
     }
     catch
     {
         return(StatusCode(500));
     }
 }
Beispiel #2
0
        public async Task <IActionResult> Update(int Id, [FromBody] ManagerVM managerVM)
        {
            try
            {
                Manager m = await this.managerAPI.GetById(Id);

                m = managerVM.ToModel(m);
                return(this.Ok(await managerAPI.Update(m)));
            }
            catch
            {
                return(StatusCode(500));
            }
        }