public Obstacle[] GetObstacles()
 {
     using (var db = new DatabaseContext())
     {
         return db.Obstacles.Select(obstacle => (Obstacle)obstacle).ToArray();
     }
 }
 public Robot GetRobotById(int robotId)
 {
     using (var db = new DatabaseContext())
     {
         return (Robot)db.Robots.Find(robotId);
     }
 }
 public Robot[] GetRobots()
 {
     using (var db = new DatabaseContext())
     {
         return db.Robots.Select(robot => (Robot)robot).ToArray();
     }
 }
 public Position[] GetPositions()
 {
     using (var db = new DatabaseContext())
     {
         return db.Positions.Select(position => (Position)position).ToArray();
     }
 }
 public Description[] GetDescriptions()
 {
     using (var db = new DatabaseContext())
     {
         return db.Descriptions.Select(description => (Description)description).ToArray();
     }
 }
 public CompetitionType[] GetCompetitionTypes()
 {
     using (var db = new DatabaseContext())
     {
         return db.CompetitionTypes.Select(competitionType => (CompetitionType)competitionType).ToArray();
     }
 }
 public Member[] GetMembers()
 {
     using (var db = new DatabaseContext())
     {
         return db.Members.Select(member => (Member)member).ToArray();
     }
 }
 public Team GetTeamById(int teamId)
 {
     using (var db = new DatabaseContext())
     {
         return (Team)db.Teams.Find(teamId);
     }
 }
 public Team[] GetTeams()
 {
     using (var db = new DatabaseContext())
     {
         return db.Teams.Select(team => (Team)team).ToArray();
     }
 }
 public Strength GetStrengthById(int strengthId)
 {
     using (var db = new DatabaseContext())
     {
         return (Strength)db.Strengths.Find(strengthId);
     }
 }
 public Strength[] GetStrengths()
 {
     using (var db = new DatabaseContext())
     {
         return db.Strengths.Select(strength => (Strength)strength).ToArray();
     }
 }
 public Game[] GetGames()
 {
     using (var db = new DatabaseContext())
     {
         return db.Games.Select(game => (Game)game).ToArray();
     }
 }
 public Game GetGameById(int gameId)
 {
     using (var db = new DatabaseContext())
     {
         return (Game)db.Games.Find(gameId);
     }
 }
 public Match GetMatchById(int matchId)
 {
     using (var db = new DatabaseContext())
     {
         return (Match)db.Matches.Find(matchId);
     }
 }
 public Year[] GetYears()
 {
     using (var db = new DatabaseContext())
     {
         return db.Years.Select(year => (Year)year).ToArray();
     }
 }
 public MatchType GetMatchTypeById(int matchTypeId)
 {
     using (var db = new DatabaseContext())
     {
         return (MatchType)db.MatchTypes.Find(matchTypeId);
     }
 }
 public CompetitionType GetCompetitionTypeById(int competitionTypeId)
 {
     using (var db = new DatabaseContext())
     {
         return (CompetitionType)db.CompetitionTypes.Find(competitionTypeId);
     }
 }
 public MatchType[] GetMatchTypes()
 {
     using (var db = new DatabaseContext())
     {
         return db.MatchTypes.Select(matchType => (MatchType)matchType).ToArray();
     }
 }
 public Member GetMemberById(int memberId)
 {
     using (var db = new DatabaseContext())
     {
         return (Member)db.Members.Find(memberId);
     }
 }
 public Competition GetCompetitionById(int competitionId)
 {
     using (var db = new DatabaseContext())
     {
         return (Competition)db.Competitions.Find(competitionId);
     }
 }
 public Position GetPositionById(int positionId)
 {
     using (var db = new DatabaseContext())
     {
         return (Position)db.Positions.Find(positionId);
     }
 }
 public Competition[] GetCompetitions()
 {
     using (var db = new DatabaseContext())
     {
         return db.Competitions.Select(competition => (Competition)competition).ToArray();
     }
 }
 public Description GetDescriptionById(int descriptionId)
 {
     using (var db = new DatabaseContext())
     {
         return (Description)db.Descriptions.Find(descriptionId);
     }
 }
 public Year GetYearById(int yearId)
 {
     using (var db = new DatabaseContext())
     {
         return (Year)db.Years.Find(yearId);
     }
 }
 public Obstacle GetObstacleById(int obstacleId)
 {
     using (var db = new DatabaseContext())
     {
         return (Obstacle)db.Obstacles.Find(obstacleId);
     }
 }
 public Mat[] GetMats()
 {
     using (var db = new DatabaseContext())
     {
         return db.Mats.Select(mat => (Mat)mat).ToArray();
     }
 }
 public Mat GetMatById(int matId)
 {
     using (var db = new DatabaseContext())
     {
         return (Mat)db.Mats.Find(matId);
     }
 }
 public Mat ModifyMat(Mat newMat)
 {
     using (var db = new DatabaseContext())
     {
         db.Entry(newMat).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         return (Mat)db.Mats.Find(newMat.MatId);
     }
 }
 public Mat CreateMat(Mat mat)
 {
     using (var db = new DatabaseContext())
     {
         Mat addedMat = (Mat)db.Mats.Add((EntityFramework.Mat)mat);
         db.SaveChanges();
         return addedMat;
     }
 }
 public Description ModifyDescription(Description newDescription)
 {
     using (var db = new DatabaseContext())
     {
         db.Entry(newDescription).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         return (Description)db.Descriptions.Find(newDescription.DescriptionId);
     }
 }