public static List <Link> GetGameFamilies(this Game game) { return(game .GetGameItem() .Link .Where(link => string.Equals(link.Type, BOARDGAME_FAMILY) && !string.Equals(link.Value, ADMIN_NOT_TO_ADD)) .ToList()); }
public static int GetId(this Game game) { var item = game.GetGameItem(); if (item == null) { throw new NullReferenceException("Game item returned null"); } return(int.Parse(item.Id)); }
// Methods to get internal objects / properties private static string GetValue(this Game game, string propName) { var gameItem = game.GetGameItem(); var obj = gameItem .GetType() .GetProperty(propName) ?.GetValue(gameItem, null); return(obj? .GetType() .GetProperty("Value") ?.GetValue(obj, null) as string); }
public static string GetName(this Game game) { return(game.GetGameItem()?.Name.FirstOrDefault(name => string.Equals(name.Type, PRIMARY_NAME))?.Value); }
private static Ratings GetStatistics(this Game game) { return(game.GetGameItem().Statistics.Ratings); }
public static List <Link> GetGameMechanics(this Game game) { return(game.GetGameItem().Link.Where(link => string.Equals(link.Type, BOARDGAME_MECHANIC)).ToList()); }
public static List <Link> GetGameCategories(this Game game) { return(game.GetGameItem().Link.Where(link => string.Equals(link.Type, BOARDGAME_CATEGORY)).ToList()); }