public async Task <string> UpdateRecord(ShopBridgeVM shopBridgeVM) { try { if (!String.IsNullOrWhiteSpace(shopBridgeVM.Id)) { var shopBridgeItemDM = new ShopBridgeDM(); shopBridgeItemDM.Id = Guid.Parse(shopBridgeVM.Id); shopBridgeItemDM.Name = shopBridgeVM.Name; shopBridgeItemDM.Price = shopBridgeVM.Price; shopBridgeItemDM.Description = shopBridgeVM.Description; return(await _shopBridgeDataAccess.UpdateRecord(shopBridgeItemDM)); } return(null); } catch { throw; } }
public async Task <string> PostRecord(ShopBridgeVM shopBridgeVM) { try { if (String.IsNullOrWhiteSpace(shopBridgeVM.Id)) { var shopBridgeItemDM = new ShopBridgeDM(); shopBridgeItemDM.Id = new Guid(); shopBridgeItemDM.Name = shopBridgeVM.Name; shopBridgeItemDM.Price = shopBridgeVM.Price; shopBridgeItemDM.Description = shopBridgeVM.Description; return(await _shopBridgeDataAccess.PostRecord(shopBridgeItemDM)); } return(null); } catch (Exception ex) { return(null); } }