public IList <CompetitionClass> GetClasses() { using (var connection = new MySqlConnection(_databaseConfiguration.GetConnectionString())) { var classRepository = new ClassRepository(connection); return(classRepository .GetByEventRaceIdAndEventId(_eventRaceId, _eventId) .ToContracts()); } }