Example #1
0
 public IActionResult CreateBA([FromBody] BankAccount ba)
 {
     if (ba != null)
     {
         try
         {
             using (var scope = new TransactionScope())
             {
                 var banum = _baRepository.CreateBA(ba);
                 scope.Complete();
                 return(CreatedAtAction("GET", new { banknum = banum }, banum));
             }
         }
         catch (Exception ex)
         {
             return(BadRequest(new { message = ex.Message }));
         }
     }
     return(new NoContentResult());
 }