Ejemplo n.º 1
0
 public  ProductOperationResponse ProcessRequest(ProductOperationRequest request)
 {
     var result = new ProductOperationResponse();
     switch (request.Action)
     {
         case DataAction.Create:
             SaveEntity(request.Product.ToEntity());
             break;
         case DataAction.Read:
             result.Products = ReadProducts(request.ProductId,request.NamePart);
             break;
         case DataAction.Update:
             result.Products = UpdateEntity<Product, ProductContract>(request.Product);
             break;
         case DataAction.Delete:
             DeleteEntity<Product>(request.ProductId);
             break;
     }
     Singletone.Instance.Context.SaveChanges();
     return result;
 }
Ejemplo n.º 2
0
 public ProductOperationResponse ProductOperation(ProductOperationRequest message)
 {
     return new ProductDao().ProcessRequest(message);
 }