public static int[] GetGroupAffinities(this IGroupSystem groupSystem) { var affinity = groupSystem.GetType() .GetCustomAttributes(typeof(CollectionAffinityAttribute), true) .FirstOrDefault(); return(((CollectionAffinityAttribute)affinity)?.CollectionIds); }
public static int[] GetGroupAffinities(this IGroupSystem system) { if (system is null) { throw new ArgumentNullException(nameof(system)); } var affinity = system.GetType().GetCustomAttribute(typeof(CollectionAffinityAttribute), true); return(((CollectionAffinityAttribute)affinity)?.CollectionIds); }