.net安全性的一个最大缺点是安全注释并不存在于mvc控制器之外。
CustomerController
致电CustomerService
来电CustomerRepository
以上每个都在不同的dll中。
我希望使用注释保护CustomerService
,而不是CustomerController
。
感谢
答案 0 :(得分:1)
可以在servicestack上进行吗?这是好的做法吗?
在ServiceStack you can apply authentication/authorization attributes at different levels内(请求Dto,服务操作,服务类或Serivce的基类)。您也可以创建Filter Attributes。
是否有任何带有servicestack的n层架构示例?
This is not so much an example但是ServiceStack项目的典型布局结构。