public IActionResult Create([FromBody] BankingEntity bank) { this.Context.Banks.Add(bank); this.Context.SaveChanges(); return(this.Ok(bank)); }
public void MoveCustomersToBankingEntity(Guid[] customerIds, BankingEntity bankingEntity) { var client = new PublicServiceChannel(); try { client.MoveCustomersToBankingEntity(customerIds, bankingEntity); client.Close(); } catch (CommunicationException) { client.Abort(); throw; } catch (TimeoutException) { client.Abort(); throw; } catch (Exception) { client.Abort(); throw; } }
public void MoveCustomersToBankingEntity(Guid[] customerIds, BankingEntity bankingEntity) { var client = new PublicServiceChannel(); try { client.MoveCustomersToBankingEntity(customerIds, bankingEntity); client.Close(); } catch (CommunicationException) { client.Abort(); throw; } catch (TimeoutException) { client.Abort(); throw; } catch (Exception) { client.Abort(); throw; } }
public void MoveCustomersToBankingEntity(Guid[] customerIds, BankingEntity bankingEntity) { foreach (Guid id in customerIds) { var customer = this.client.GetCustomer(id); customer.BankingEntity = bankingEntity; this.client.UpdateCustomer(customer); Console.ForegroundColor = ConsoleColor.Green; Trace.TraceInformation("[{0}] Customer {1} moved to {2}", DateTime.Now, customer.Name, bankingEntity); Console.ResetColor(); } }
public void MoveCustomersToBankingEntity(Guid[] customerIds, BankingEntity bankingEntity) { foreach (Guid id in customerIds) { var customer = this.client.GetCustomer(id); customer.BankingEntity = bankingEntity; this.client.UpdateCustomer(customer); Console.ForegroundColor = ConsoleColor.Green; Trace.TraceInformation("[{0}] Customer {1} moved to {2}", DateTime.Now, customer.Name, bankingEntity); Console.ResetColor(); } }
public IActionResult Edit(int id, [FromBody] BankingEntity dto) { dto.Id = id; try { this.Context.Update(dto); this.Context.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!this.Context.Banks.Any(m => m.Id == id)) { return(this.NotFound()); } throw; } return(this.NoContent()); }
public void MoveCustomersToBankingEntity(Guid[] customerIds, BankingEntity bankingEntity) { this.Channel.MoveCustomersToBankingEntity(customerIds, bankingEntity); }