我有一个 MVC 属性,我需要使用属性注入与构造函数注入。我正在使用结构映射通过 xml 配置进行注入。该属性永远不会被设置,有人看到我做错了什么吗?谢谢
public class RequirePermissionAttribute: AuthorizeAttribute, IAuthorizationFilter
{
#region Fields
private readonly IPermissionService _permissionService;
#endregion
#region Properties
[SetterProperty]
public IPermissionService PermissionService
{
get
{
return _permissionService;
}
set
{
value = _permissionService;
}
}
……
配置文件
<DefaultInstance PluggedType="Service.Permissions.PermissionService,Service" PluginType="Service.Permissions.IPermissionService,Service" Scope="HttpContext" />