说明.txt
(完整代码) 1KB/************************ 用法start ************************* /
//1.声明一个继承RandomObject的实体类,如:*
public class AdvertEntity : RandomObject
{
/// <summary>
/// 名称
/// </summary>
public string Name { set; get; }
/// <summary>
/// 描述
/// </summary>
public string Description { set; get; }
//...其它相关的字段/属性
}
//2.初始化调用数据,如:
//初始化模拟权重数据
List<Advert> list = new List<Advert>();
list.Add(new Advert { Name = "A", Weight = 1 });
list.Add(new Advert { Name = "B", Weight = 2 });
list.Add(new Advert { Name = "C", Weight = 2 });
list.Add(new Advert { Name = "D", Weight = 3 });
list.Add(new Advert { Name = "E", Weight = 4 });
list.Add(new Advert { Name = "F", Weight = 5 });
list.Add(new Advert { Name = "G", Weight = 60 });
//根据权重随机取指定记录条数
List<Advert> newList = RandomHelper.GetRandomList<Advert>(list, 2); //这个就是用法,newList就是随机取出的记录(第二个参数就是随机取多少条)
/ ************************ 用法end *************************/
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。