Exemple #1
0
        public async Task <bool> Delete(Product_PaymentMethod Product_PaymentMethod)
        {
            Product_PaymentMethodDAO Product_PaymentMethodDAO = await DataContext.Product_PaymentMethod.Where(x => x.ProductId == Product_PaymentMethod.ProductId && x.PaymentMethodId == Product_PaymentMethod.PaymentMethodId).FirstOrDefaultAsync();

            DataContext.Product_PaymentMethod.Remove(Product_PaymentMethodDAO);
            await DataContext.SaveChangesAsync();

            return(true);
        }
Exemple #2
0
        public async Task <bool> Update(Product_PaymentMethod Product_PaymentMethod)
        {
            Product_PaymentMethodDAO Product_PaymentMethodDAO = DataContext.Product_PaymentMethod.Where(x => x.ProductId == Product_PaymentMethod.ProductId && x.PaymentMethodId == Product_PaymentMethod.PaymentMethodId).FirstOrDefault();

            Product_PaymentMethodDAO.ProductId       = Product_PaymentMethod.ProductId;
            Product_PaymentMethodDAO.PaymentMethodId = Product_PaymentMethod.PaymentMethodId;
            await DataContext.SaveChangesAsync();

            return(true);
        }
Exemple #3
0
        public async Task <bool> Create(Product_PaymentMethod Product_PaymentMethod)
        {
            Product_PaymentMethodDAO Product_PaymentMethodDAO = new Product_PaymentMethodDAO();

            Product_PaymentMethodDAO.ProductId       = Product_PaymentMethod.ProductId;
            Product_PaymentMethodDAO.PaymentMethodId = Product_PaymentMethod.PaymentMethodId;

            await DataContext.Product_PaymentMethod.AddAsync(Product_PaymentMethodDAO);

            await DataContext.SaveChangesAsync();

            return(true);
        }