Ejemplo n.º 1
0
        public static IQueryable <User> GetUsersForPlatform(PlatformId[] platformId, BitcornContext dbContext)
        {
            HashSet <string> ids = platformId.Select(p => p.Id).ToHashSet();

            switch (platformId[0].Platform)
            {
            case "auth0":
                return(dbContext.Auth0ManyQuery(ids));

            case "twitch":
                return(dbContext.TwitchManyQuery(ids));

            case "discord":
                return(dbContext.DiscordManyQuery(ids));

            case "twitter":
                return(dbContext.TwitterManyQuery(ids));

            case "reddit":
                return(dbContext.RedditManyQuery(ids));

            default:
                throw new Exception($"Platform {platformId[0].Platform} could not be found");
            }
        }