private double SumTotalPrice(CloudVM key1, CloudStorage key2, CloudFunction key3, CloudDbSQL key4) { double sum = 0; sum += key1 != null ? key1.Price : 0; sum += key2 != null ? key2.Price : 0; sum += key3 != null ? key3.Price : 0; sum += key4 != null ? key4.Price : 0; return(sum); }
public object Update(CloudVM entity) { try { _uow.CloudVM.Update(entity); _uow.Complete(); return(new { message = "Succesfully updated" }); } catch (Exception ex) { throw new Exception("Failed to update", ex); } finally { _uow.Dispose(); } }
public CloudVM Get(int id) { try { CloudVM result = _uow.CloudVM.Get(id); if (result == null) { throw new Exception("Not found"); } return(result); } catch (Exception ex) { throw new Exception("Failed to get by id", ex); } }
public object Add(CloudVM entity) { try { _uow.CloudVM.Add(entity); _uow.Complete(); return(new { message = "Succesfully added" }); } catch (Exception ex) { throw new Exception("Failed at adding new object", ex); } finally { _uow.Dispose(); } }
public ActionResult Remove([FromBody] CloudVM cloudVM) { return(Ok(_cloudVMService.Remove(cloudVM))); }
public ActionResult Update([FromBody] CloudVM cloudVM) { return(Ok(_cloudVMService.Update(cloudVM))); }
public ActionResult Add([FromBody] CloudVM cloudVM) { return(Ok(_cloudVMService.Add(cloudVM))); }