我有一个自定义属性CustomAttribute,AllowMultiple=true
允许对同一对象多次设置该属性,例如[CustomAttribute("xxx")]
[CustomAttribute("dsx")]
[[CustomAttribute("ewc")]
public Class eee{}
我通过Type.GetCustomAttributes获取这个类的这个属性的一个集合,请问他有固定的顺序吗?
Type.GetCustomAttributes(typeof(CustomAttribute),true).Where(.....)我后面还用了linq,没有影响吧
允许对同一对象多次设置该属性,例如[CustomAttribute("xxx")]
[CustomAttribute("dsx")]
[[CustomAttribute("ewc")]
public Class eee{}
我通过Type.GetCustomAttributes获取这个类的这个属性的一个集合,请问他有固定的顺序吗?
Type.GetCustomAttributes(typeof(CustomAttribute),true).Where(.....)我后面还用了linq,没有影响吧
比如
name="鸡腿",value="4"
name="鸭肉",value="15"
name="牛肉",value="9"
name="鸭肉",value="14"我用name来区分,但是我又不能保证程序员注册相同name的属性,这样我就需要对于相同name的以最后一个为准