我正在使用ASP.NET Web API,我需要获得授权,因此我创建了自定义授权属性
public class CustomAuthorizationAttribute : AuthorizeAttribute
Run Code Online (Sandbox Code Playgroud)
为了在构造函数中注入依赖项,我有以下内容:
public CustomAuthorizationAttribute(IAccountBL accountBl)
{
_accountBL = accountBl;
}
Run Code Online (Sandbox Code Playgroud)
在IAccountBL我的方法,它与用户是否被授权作出要求数据库检查交互.在内部成员API控制器中,我注册了该属性
[CustomAuthorization]
public class MemberController : ApiController
Run Code Online (Sandbox Code Playgroud)
但我得到以下错误
Project.Account.AccountBL'不包含带0个参数的构造函数
如果我注册就好
[CustomAuthorization(IAccountBL)]
Run Code Online (Sandbox Code Playgroud)

谢谢
我正在尝试为平板电脑和移动设备制作单独的视图.在app_start我有这个代码
DisplayModeProvider.Instance.Modes.Insert(0, new
DefaultDisplayMode("Tablet")
{
ContextCondition = (ctx =>
ctx.Request.UserAgent.IndexOf("iPad", StringComparison.OrdinalIgnoreCase) >= 0 ||
ctx.Request.UserAgent.IndexOf("Android", StringComparison.OrdinalIgnoreCase) >= 0)
});
Run Code Online (Sandbox Code Playgroud)
我创建了两个布局文件,一个用于移动设备,另一个用于平板电脑.但是当我从Android上的移动设备访问时存在冲突.它将我重定向到layout.tablet.我怎么能分开这两个设备?
我很难搞清楚如何处理来自Amazon SQS的消息.
我正在尝试实现以下内容:
令我困扰的是如何实施第2步.我有课SQSConnector和ProfileDao.现在,我想简单的实现,通过初始化SQSConnector中ProfileDao,并从队列中接收消息.我的想法是启动新线程,开始轮询消息,当队列为空时中断线程ProfileDao.
返回/处理消息的最佳方法是什么(回调函数?),如果有另一种方法可以做到这一点,我可以选择.
谢谢
是否有可能使用Jqplot或Google Visualizations这样的东西

到目前为止,我能够用jqplot创建类似但不完全是我想要的东西

码:
var style = {
seriesDefaults: {
fill: true,
fillToZero: true,
fillAndStroke: true,
color: "rgba(190,230,110, 0.8)",
fillColor: "rgba(206,236,145, 0.8)",
shadow: false,
lineWidth: 1,
rendererOptions: {
highlightMouseOver: false
}
},
seriesColors: ["#009900", "#000099", "#00cc00", "#0000cc"],
negativeSeriesColors: ["#bb0000", "#ffe700", "#dd0000"] };
Run Code Online (Sandbox Code Playgroud)