这是我的 API 操作过滤器,我希望能够返回 ccaccount obj
调用方法的登录结果良好
知道怎么做吗?
谢谢
public class CAPILoginFilter : ActionFilterAttribute
{
public override void OnActionExecuting(HttpActionContext i_actionContext)
{
CRequestBase request = (CRequestBase)i_actionContext.ActionArguments["i_request"];
CCAccount account = CAPILogin.AccountIDGetOBJ(request.UserName, request.Password);
if(account == null)
{
throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.Unauthorized));
}
else
{
//return account object to calling method here
}
}
}