コード例 #1
0
        public async Task <AppBuyer> UpdateBuyer(AppBuyer buyer)
        {
            if (db != null)
            {
                //Delete that post
                db.AppBuyer.Update(buyer);

                //Commit the transaction
                await db.SaveChangesAsync();
            }

            return(buyer);
        }
コード例 #2
0
        public async Task <AppBuyer> AddBuyer(AppBuyer buyer)
        {
            if (db != null)
            {
                await db.AppBuyer.AddAsync(buyer);

                await db.SaveChangesAsync();

                return(buyer);
            }

            return(buyer);
        }
コード例 #3
0
        public async Task <int> DeleteBuyer(AppBuyer buyer)
        {
            int result = 0;

            if (db != null)
            {
                //Find the post for specific post id
                var buyerDel = await db.AppBuyer.FirstOrDefaultAsync(p => p.AppBuyerId == buyer.AppBuyerId);

                if (buyerDel != null)
                {
                    //Delete that post
                    db.AppBuyer.Remove(buyerDel);

                    //Commit the transaction
                    result = await db.SaveChangesAsync();
                }
                return(result);
            }

            return(result);
        }
コード例 #4
0
        public ActionResult Connect(int Id)
        {
            AppBuyer appBuyer = unit.GetBuyer(Id).FromDomainBuyerToRepoBuyer();

            return(View(appBuyer));
        }