//Create public AppUser Insert(AppUser appuser) { using (OrderTrackEntities ctx = new OrderTrackEntities()) { ctx.AppUser.Add(appuser); ctx.SaveChanges(); return this; } }
//Update public AppUser Update(AppUser appuser) { using (OrderTrackEntities ctx = new OrderTrackEntities()) { AppUser AppUser = ctx.AppUser.First(x => x.AppUserID == this.AppUserID); AppUser = appuser; ctx.SaveChanges(); return AppUser; } }
public AppUser Put(AppUser appuser) { return new AppUser().Insert(appuser); }
public AppUser Post(AppUser appuser) { return new AppUser().Update(appuser); }