本文整理汇总了C#中IFormsAuthenticationService类的典型用法代码示例。如果您正苦于以下问题:C# IFormsAuthenticationService类的具体用法?C# IFormsAuthenticationService怎么用?C# IFormsAuthenticationService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IFormsAuthenticationService类属于命名空间,在下文中一共展示了IFormsAuthenticationService类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: AccountController
public AccountController(IFormsAuthenticationService formsService, IMembershipService membershipService, IUserService userService, IMasterService masterService)
{
this.formsService = formsService;
this.membershipService = membershipService;
this.userService = userService;
this.masterService = masterService;
}
开发者ID:gchamoli,项目名称:DMP,代码行数:7,代码来源:AccountController.cs
示例2: GetUserFriendlyName
/// <summary>
/// Return how we want to display the user's name in the UI. Currently set to Username, could be changed to First/Last, etc,
/// </summary>
/// <param name="FormsAuthService"></param>
/// <returns></returns>
public static string GetUserFriendlyName(IFormsAuthenticationService FormsAuthService)
{
return HttpContext.Current.Cache.GetOrStore<string>(
GetUserSignInKey(FormsAuthService, UserFriendlyNameKey),
() =>
{
if (FormsAuthService.IsAuthenticated())
{
using (SiteDB db = new SiteDB())
{
var user = UserRepository.GetUser(db, FormsAuthService.GetCurrentUserId());
if (user != null)
{
return user.Username;
}
else
{
return "";
}
}
}
else
{
return "";
}
}
);
}
开发者ID:aljubicic,项目名称:MVC3-Boilerplate,代码行数:33,代码来源:CacheHelper.cs
示例3: HomeController
public HomeController(ISession session, IFormsAuthenticationService FormsAuthService)
{
_session = session;
_userRepository = new UserRepository(_session);
this.FormsAuthService = FormsAuthService;
}
开发者ID:crdeutsch,项目名称:MVC3-Boilerplate-NHibernate,代码行数:7,代码来源:HomeController.cs
示例4: PivotalTrackerApi
public PivotalTrackerApi(IFormsAuthenticationService formsAuthenticationService )
{
this.formsAuthenticationService = formsAuthenticationService;
//user = new PivotalUser(Configuration.PivotalApiToken);
user = new PivotalUser(this.formsAuthenticationService.ApiToken());
}
开发者ID:petemckee,项目名称:PivotalImporter,代码行数:7,代码来源:PivotalTrackerApi.cs
示例5: AccountController
public AccountController(IDbContext dbContext, IRepresentativeUserService representativeUserService, IFormsAuthenticationService formsAuthentication, IUserService userService)
{
_dbContext = dbContext;
_representativeUserService = representativeUserService;
_formsAuthentication = formsAuthentication;
_userService = userService;
}
开发者ID:raminmjj,项目名称:SportsSystem,代码行数:7,代码来源:AccountController.cs
示例6: AccountController
// This constructor is not used by the MVC framework but is instead provided for ease
// of unit testing this type. See the comments in AccountModels.cs for more information.
public AccountController(IFormsAuthenticationService formsService,
IMembershipService membershipService)
{
FormsService = formsService ?? new FormsAuthenticationService();
MembershipService = membershipService ??
new AccountMembershipService();
}
开发者ID:jeffreypalermo,项目名称:mvc2inaction,代码行数:9,代码来源:AccountController.cs
示例7: AuthenticationController
public AuthenticationController(
IFormsAuthenticationService formsAuthService,
IUserService userService)
{
FormsAuth = formsAuthService;
UserService = userService;
}
开发者ID:projectkudu,项目名称:NuGetGallery,代码行数:7,代码来源:AuthenticationController.cs
示例8: GetUserFriendlyName
/// <summary>
/// Return how we want to display the user's name in the UI. Currently set to Username, could be changed to First/Last, etc,
/// </summary>
/// <param name="FormsAuthService"></param>
/// <returns></returns>
public static string GetUserFriendlyName(IFormsAuthenticationService FormsAuthService)
{
return HttpContext.Current.Cache.GetOrStore<string>(
GetUserSignInKey(FormsAuthService, UserFriendlyNameKey),
() =>
{
if (FormsAuthService.IsAuthenticated())
{
var userRepository = new UserRepository(MvcApplication.SessionFactory.OpenSession());
var user = userRepository.GetUser(FormsAuthService.GetCurrentUserName());
if (user != null)
{
return user.Username;
}
else
{
return "";
}
}
else
{
return "";
}
}
);
}
开发者ID:crdeutsch,项目名称:MVC3-Boilerplate-NHibernate,代码行数:31,代码来源:CacheHelper.cs
示例9: LangController
public LangController(
IUserService userService,
IFormsAuthenticationService formsAuthenticationService)
: base(userService, formsAuthenticationService)
{
}
开发者ID:kpuru2,项目名称:set-locale,代码行数:7,代码来源:LangController.cs
示例10: UserController
public UserController(IUnitOfWork uow, IUserService userService, IRoleService roleService, IFormsAuthenticationService formsAuthenticationService)
{
_uow = uow;
_userService = userService;
_roleService = roleService;
_formsAuthenticationService = formsAuthenticationService;
}
开发者ID:wria7,项目名称:IrisCms,代码行数:7,代码来源:UserController.cs
示例11: AccountController
public AccountController(
IFormsAuthenticationService formsAuthenticationService,
MySettings mySettings)
{
_formsAuthenticationService = formsAuthenticationService;
_mySettings = mySettings;
}
开发者ID:peisheng,项目名称:EASYFRAMEWORK,代码行数:7,代码来源:AccountController.cs
示例12: UserController
public UserController(
IUserService userService,
IFormsAuthenticationService formsAuthenticationService)
{
_formsAuthenticationService = formsAuthenticationService;
_userService = userService;
}
开发者ID:netexpert1983,项目名称:set-basic-aspnet-mvc,代码行数:7,代码来源:UserController.cs
示例13: AuthenticationController
public AuthenticationController(
IFormsAuthenticationService formsAuthSvc,
IUserService userSvc)
{
this.formsAuthSvc = formsAuthSvc;
this.userSvc = userSvc;
}
开发者ID:Redsandro,项目名称:chocolatey.org,代码行数:7,代码来源:AuthenticationController.cs
示例14: AccountController
/// <summary>
/// Initializes a new instance of the <see cref="AccountController"/> class.
/// </summary>
/// <param name="formsAuthenticationService">The forms authentication service.</param>
/// <param name="membershipService">The membership service.</param>
public AccountController(
IFormsAuthenticationService formsAuthenticationService,
IMembershipService membershipService)
{
this.MembershipService = membershipService;
this.FormsService = formsAuthenticationService;
}
开发者ID:nectide,项目名称:ninject.web.mvc,代码行数:12,代码来源:AccountController.cs
示例15: BCProxyLoginController
public BCProxyLoginController(IPortalUserFacade portalUserFacade, ILoginService loginService, IFormsAuthenticationService formsAuthenticationService, IPortletTemplateFacade portletTemplateFacade)
{
_loginService = loginService;
_formsAuthenticationService = formsAuthenticationService;
_portletTemplateFacade = portletTemplateFacade;
_portalUserFacade = portalUserFacade;
}
开发者ID:Erls-Corporation,项目名称:BCProxyLoginPortlet,代码行数:7,代码来源:BCProxyLoginController.cs
示例16: TwitterController
public TwitterController(IFormsAuthenticationService FormsAuthService)
{
_db = new SiteDB();
_log = new UserActivity(_db);
this.FormsAuthService = FormsAuthService;
}
开发者ID:crdeutsch,项目名称:WatchedIt,代码行数:7,代码来源:TwitterController.cs
示例17: AuthenticationService
public AuthenticationService(ICurrentSDKUser currentSdkUser, IFormsAuthenticationService formsAuthentication, IUserAuthenticator agentAuthenticator, IClarifySessionCache sessionCache, IPrincipalFactory principalFactory)
{
_currentSdkUser = currentSdkUser;
_formsAuthentication = formsAuthentication;
_agentAuthenticator = agentAuthenticator;
_sessionCache = sessionCache;
_principalFactory = principalFactory;
}
开发者ID:KevM,项目名称:dovetail-bootstrap,代码行数:8,代码来源:AuthenticationService.cs
示例18: WordController
public WordController(
IWordService wordService,
IUserService userService,
IFormsAuthenticationService formsAuthenticationService)
: base(userService, formsAuthenticationService)
{
_wordService = wordService;
}
开发者ID:jk915,项目名称:set-locale,代码行数:8,代码来源:WordController.cs
示例19: AccountController
public AccountController(IFormsAuthenticationService formsService,
IMembershipService membershipService,
ILogger logger)
{
this._FormsService = formsService;
this._MembershipService = membershipService;
this._Logger = logger;
}
开发者ID:tah91,项目名称:eworkyWebSite,代码行数:8,代码来源:AccountController.cs
示例20: TagController
public TagController(
ITagService tagService,
IUserService userService,
IFormsAuthenticationService formsAuthenticationService)
: base(userService, formsAuthenticationService)
{
_tagService = tagService;
}
开发者ID:jk915,项目名称:set-locale,代码行数:8,代码来源:TagController.cs
注:本文中的IFormsAuthenticationService类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论