public Models.Team Delete(Guid id) { Models.Team team = this.Get(id); this.dbContext.Remove(team); this.dbContext.SaveChanges(); return(team); }
public Models.Team Update(Models.Team team) { Models.Team deletedTeam = this.Delete(team.ID); if (deletedTeam != null) { deletedTeam = this.Add(team); } return(deletedTeam); }
public Models.Team Delete(Guid id) { var q = teams.Where(t => t.ID == id); Models.Team team = null; if (q.Any()) { team = q.First(); teams.Remove(team); } return(team); }
public Models.Team Add(Models.Team team) { teams.Add(team); return(team); }
public Models.Team Add(Models.Team team) { this.dbContext.Teams.Add(team); this.dbContext.SaveChanges(); return(team); }
public Models.Team Update(Models.Team team) { this.dbContext.Entry(team).State = EntityState.Modified; this.dbContext.SaveChanges(); return(team); }