Example #1
0
 public IActionResult Post([FromBody] CreateAccountPostData data)
 {
     if (manager.Create(data))
     {
         return(Ok());
     }
     return(StatusCode(409));
 }
 public IActionResult Post([FromBody] CreateAccountPostData data)
 {
     try
     {
         manager.Create(data);
     }
     catch (MySqlException ex)
     {
         var tokens = ex.Message.Split(" ");
         var field  = tokens[tokens.Length - 1].Replace("'", "");
         return(StatusCode(409, new
         {
             field
         }));
     }
     return(Ok());
 }