19
09/17
C#/EF获取随机数据
/// <summary> /// 获取随机推荐的资源 /// </summary> public List<ResourceOutputDto> GetRandomRecommendResources(int count) { var result = new List<ResourceOutputDto>(); Random rd = new Random(); var maxCount = _resourceManager.GetAll().Where(f => f.Status == true).Count(); for (int i = 0; i < count; i++) { var randomCount = rd.Next(...