public async Task <bool> Delete(Product_MerchantAddress Product_MerchantAddress) { Product_MerchantAddressDAO Product_MerchantAddressDAO = await DataContext.Product_MerchantAddress.Where(x => x.ProductId == Product_MerchantAddress.ProductId && x.MerchantAddressId == Product_MerchantAddress.MerchantAddressId).FirstOrDefaultAsync(); DataContext.Product_MerchantAddress.Remove(Product_MerchantAddressDAO); await DataContext.SaveChangesAsync(); return(true); }
public async Task <bool> Update(Product_MerchantAddress Product_MerchantAddress) { Product_MerchantAddressDAO Product_MerchantAddressDAO = DataContext.Product_MerchantAddress.Where(x => x.ProductId == Product_MerchantAddress.ProductId && x.MerchantAddressId == Product_MerchantAddress.MerchantAddressId).FirstOrDefault(); Product_MerchantAddressDAO.ProductId = Product_MerchantAddress.ProductId; Product_MerchantAddressDAO.MerchantAddressId = Product_MerchantAddress.MerchantAddressId; await DataContext.SaveChangesAsync(); return(true); }
public async Task <bool> Create(Product_MerchantAddress Product_MerchantAddress) { Product_MerchantAddressDAO Product_MerchantAddressDAO = new Product_MerchantAddressDAO(); Product_MerchantAddressDAO.ProductId = Product_MerchantAddress.ProductId; Product_MerchantAddressDAO.MerchantAddressId = Product_MerchantAddress.MerchantAddressId; await DataContext.Product_MerchantAddress.AddAsync(Product_MerchantAddressDAO); await DataContext.SaveChangesAsync(); return(true); }