public static CurrentApplication GetApplication(Application applicationDb) { return(new CurrentApplication() { TeamId = applicationDb.TeamId, Id = applicationDb.ApplicationId, Accepted = applicationDb.IsAccepted, Paid = applicationDb.HasPaid, TeamName = applicationDb.Team.Name, Players = CurrentApplication.PlayersHelper(applicationDb.Players) }); }
public static List <CurrentApplication> GetApplications(DbSet <Application> applicationsDb) { return(applicationsDb.Select(a => new CurrentApplication() { Id = a.ApplicationId, TeamId = a.TeamId, TeamName = a.Team.Name, Accepted = a.IsAccepted, Paid = a.HasPaid, Players = CurrentApplication.PlayersHelper(a.Players) }) .ToList()); }