public async Task <bool> Delete(MerchantAddress MerchantAddress) { MerchantAddressDAO MerchantAddressDAO = await DataContext.MerchantAddress.Where(x => x.Id == MerchantAddress.Id).FirstOrDefaultAsync(); DataContext.MerchantAddress.Remove(MerchantAddressDAO); await DataContext.SaveChangesAsync(); return(true); }
public async Task <bool> Update(MerchantAddress MerchantAddress) { MerchantAddressDAO MerchantAddressDAO = DataContext.MerchantAddress.Where(x => x.Id == MerchantAddress.Id).FirstOrDefault(); MerchantAddressDAO.Id = MerchantAddress.Id; MerchantAddressDAO.MerchantId = MerchantAddress.MerchantId; MerchantAddressDAO.Code = MerchantAddress.Code; MerchantAddressDAO.Address = MerchantAddress.Address; MerchantAddressDAO.Contact = MerchantAddress.Contact; MerchantAddressDAO.Phone = MerchantAddress.Phone; await DataContext.SaveChangesAsync(); return(true); }
public async Task <bool> Create(MerchantAddress MerchantAddress) { MerchantAddressDAO MerchantAddressDAO = new MerchantAddressDAO(); MerchantAddressDAO.Id = MerchantAddress.Id; MerchantAddressDAO.MerchantId = MerchantAddress.MerchantId; MerchantAddressDAO.Code = MerchantAddress.Code; MerchantAddressDAO.Address = MerchantAddress.Address; MerchantAddressDAO.Contact = MerchantAddress.Contact; MerchantAddressDAO.Phone = MerchantAddress.Phone; await DataContext.MerchantAddress.AddAsync(MerchantAddressDAO); await DataContext.SaveChangesAsync(); MerchantAddress.Id = MerchantAddressDAO.Id; return(true); }