internal static IEnumerable<SelectListItem> GetPageSizes(Int32[] pageSizes = null, Int32? currentSize = null) { if (pageSizes == null) pageSizes = TableModel.DefaultPageSizes; if (currentSize.HasValue && !pageSizes.Contains(currentSize.Value)) pageSizes = pageSizes.Union(new[] { currentSize.Value }).OrderBy(p => p).ToArray(); return pageSizes.Select(i => new SelectListItem { Text = i.ToString(), Value = i.ToString(), Selected = i == TableModel.DefaultPageSize }); }
private static double GetSimilarIndexByHash(Int32[] setA, Int32[] setB) { double similarIndex = (double)(setA.Intersect(setB).Count()) / (double)(setA.Union(setB).Count()); return similarIndex; }