Ejemplo n.º 1
0
 public CustomerOperationResponse ProcessRequest(CustomerOperationRequest request)
 {
     var result = new CustomerOperationResponse();
     switch (request.Action){
         case DataAction.Create:
             SaveEntity(request.Customer.ToEntity());
             break;
         case DataAction.Read:
             result.Customers = ReadCustomers(request.CustomerId, request.NamePart);
             return result;
         case DataAction.Update:
             result.Customers = UpdateEntity<Customer,CustomerContract>(request.Customer);
             break;
         case DataAction.Delete:
             DeleteEntity<Customer>(request.CustomerId);
             break;
     }
     Singletone.Instance.Context.SaveChanges();
     return result;
 }
Ejemplo n.º 2
0
 public CustomerOperationResponse CustomerOperation(CustomerOperationRequest message)
 {
     return new CustomerDao().ProcessRequest(message);
 }