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); }
public async Task <AppBuyer> AddBuyer(AppBuyer buyer) { if (db != null) { await db.AppBuyer.AddAsync(buyer); await db.SaveChangesAsync(); return(buyer); } return(buyer); }
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); }
public ActionResult Connect(int Id) { AppBuyer appBuyer = unit.GetBuyer(Id).FromDomainBuyerToRepoBuyer(); return(View(appBuyer)); }