我有一系列价格的产品。我希望根据用户组显示相应的价格。
到目前为止,我创建了描述这些组的角色
- 行政
- 用户价格A
- 用户价格B
- 用户价格C
我想以某种方式获得当前用户角色。
像这样的东西:
public decimal Price {
get
{
var price = Prices.First(p => p.PriceType.Name == Something.CurentUser.Role);
return price;
}
}