简体   繁体   English

ASP.NET 断开连接的 Active Directory 的 MVC3 开发实践

[英]ASP.NET MVC3 Development Practices for Disconnected Active Directory

I'm starting a new MVC 3 application at the same time I'm transitioning to a more disconnected development environment where I will only occasionally be connected to the corporate network to do deployments.我正在启动一个新的 MVC 3 应用程序,同时我正在过渡到一个更加断开连接的开发环境,在那里我只会偶尔连接到公司网络进行部署。

I have normally used the [Authorize(Roles = @"xxx,yyy")] attributes to handle basic group authentication, but of course when I'm disconnected doing development, this will not work.我通常使用 [Authorize(Roles = @"xxx,yyy")] 属性来处理基本组身份验证,但是当然当我断开连接进行开发时,这将不起作用。

Does anyone have any suggestions or best practices for this kind of situation?有没有人对这种情况有任何建议或最佳实践?

Any time you need to do development against a resource that you may not have full (or any) access to, you should consider a mocking framework.每当您需要针对您可能没有完全(或任何)访问权限的资源进行开发时,您应该考虑使用 mocking 框架。 Moq and Rhino Mocks are just two of the more popular frameworks for this purpose. MoqRhino Mocks只是用于此目的的两个比较流行的框架。

The idea is to create an interface that your code will use so that you can swap in the actual AD provider or the mocking framework depending upon which environment you're working with.这个想法是创建一个您的代码将使用的接口,以便您可以根据您使用的环境交换实际的 AD 提供程序或 mocking 框架。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM