Exemplo n.º 1
0
 public ClientServiceResponse Save(Client client)
 {
     try {
         context.Add(client);
         context.SaveChanges();
         return(new ClientServiceResponse(client));
     } catch (Exception e) {
         return(new ClientServiceResponse($"Error del aplicacion: {e.Message}"));
     }
 }
Exemplo n.º 2
0
 public ServiceResponse Save(Product product)
 {
     try{
         context.Add(product);
         context.SaveChanges();
         return(new ServiceResponse(product));
     }catch (Exception e)
     {
         return(new ServiceResponse($"Error del aplicacion: {e.Message}"));
     }
 }
Exemplo n.º 3
0
 public InvoiceServiceResponse Save(Invoice invoice)
 {
     try {
         context.Add(invoice);
         context.SaveChanges();
         return(new InvoiceServiceResponse(invoice));
     } catch (Exception e) {
         return(new InvoiceServiceResponse($"Error del aplicacion: {e.Message}"));
     }
 }
Exemplo n.º 4
0
        public VehicleServiceResponse Save(Vehicle vehicle)
        {
            try {
                context.Add(vehicle);
                context.SaveChanges();
                return new VehicleServiceResponse(vehicle);

            } catch (Exception e) {
                return new VehicleServiceResponse($"Error del aplicacion: {e.Message}");
            }
        }
Exemplo n.º 5
0
 public CategoryServiceResponse Save(CategoryProduct category)
 {
     try
     {
         context.Categorys.Add(category);
         context.SaveChanges();
         return(new CategoryServiceResponse(category));
     }catch (Exception e)
     {
         return(new CategoryServiceResponse($"Error del aplicacion: {e.Message}"));
     }
 }