Example #1
0
 public async Task <IHttpActionResult> PostCartAsync(Cart cart)
 {
     DataResource.Entry(cart.Customer).State = EntityState.Modified;
     foreach (var item in cart.Items)
     {
         DataResource.Entry(item.Product).State = EntityState.Modified;
     }
     DataResource.DbSetCarts.Add(cart);
     return(Ok(await DataResource.SaveChangesAsync()));
 }
 public async Task <IHttpActionResult> PutAsync(Customer customer)
 {
     DataResource.Entry(customer).State         = EntityState.Modified;
     DataResource.Entry(customer.Address).State = EntityState.Modified;
     return(Ok(await DataResource.SaveChangesAsync()));
 }
Example #3
0
 public async Task <IHttpActionResult> PutCPUAsync(CPU cpu)
 {
     DataResource.Entry(cpu).State = EntityState.Modified;
     return(Ok(await DataResource.SaveChangesAsync()));
 }
Example #4
0
 public async Task <IHttpActionResult> PutStorageAsync(Storage storage)
 {
     DataResource.Entry(storage).State = EntityState.Modified;
     return(Ok(await DataResource.SaveChangesAsync()));
 }
Example #5
0
 public async Task <IHttpActionResult> PutMemoryAsync(Memory memory)
 {
     DataResource.Entry(memory).State = EntityState.Modified;
     return(Ok(await DataResource.SaveChangesAsync()));
 }
Example #6
0
 public async Task <IHttpActionResult> PutMotherboardAsync(Motherboard motherboard)
 {
     DataResource.Entry(motherboard).State = EntityState.Modified;
     return(Ok(await DataResource.SaveChangesAsync()));
 }