本文整理汇总了C#中IUserService类的典型用法代码示例。如果您正苦于以下问题:C# IUserService类的具体用法?C# IUserService怎么用?C# IUserService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IUserService类属于命名空间,在下文中一共展示了IUserService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UserContext
public UserContext(ICurrentUserRetriever currentUserRetriever, IUserService userService)
{
Contract.Requires<ArgumentNullException>(currentUserRetriever.IsNotNull());
Contract.Requires<ArgumentNullException>(userService.IsNotNull());
this.user = new Lazy<User>(currentUserRetriever.GetCurrentUser);
this.userService = userService;
}
示例2: UsersController
public UsersController(IUserService service, IPlansService service2, ICMSService service3)
: base(service)
{
this._userService = service;
this._plansService = service2;
this._cmsService = service3;
}
示例3: ReplyViewModel
public ReplyViewModel(IBaconProvider baconProvider, Thing replyTargetThing, RelayCommand cancel, Action<Thing> convertIntoUIReply, bool isEdit = false)
{
_convertIntoUIReply = convertIntoUIReply;
_cancel = cancel;
_baconProvider = baconProvider;
_redditService = _baconProvider.GetService<IRedditService>();
_userService = _baconProvider.GetService<IUserService>();
_markdownProcessor = _baconProvider.GetService<IMarkdownProcessor>();
_replyTargetThing = replyTargetThing;
if (isEdit)
{
Editing = true;
EditingId = ((Comment)_replyTargetThing.Data).Name;
ReplyBody = ((Comment)_replyTargetThing.Data).Body.Replace(">", ">").Replace("<", "<");
}
RefreshUserImpl();
_addBold = new RelayCommand(AddBoldImpl);
_addItalic = new RelayCommand(AddItalicImpl);
_addStrike = new RelayCommand(AddStrikeImpl);
_addSuper = new RelayCommand(AddSuperImpl);
_addLink = new RelayCommand(AddLinkImpl);
_addQuote = new RelayCommand(AddQuoteImpl);
_addCode = new RelayCommand(AddCodeImpl);
_addBullets = new RelayCommand(AddBulletsImpl);
_addNumbers = new RelayCommand(AddNumbersImpl);
_submit = new RelayCommand(SubmitImpl);
_refreshUser = new RelayCommand(RefreshUserImpl);
}
示例4: DefaultTokenService
public DefaultTokenService(IUserService users, ICoreSettings settings, IClaimsProvider claimsProvider, ITokenHandleStore tokenHandles)
{
_users = users;
_settings = settings;
_claimsProvider = claimsProvider;
_tokenHandles = tokenHandles;
}
示例5: ApiController
public ApiController(
IEntitiesContext entitiesContext,
IPackageService packageService,
IPackageFileService packageFileService,
IUserService userService,
INuGetExeDownloaderService nugetExeDownloaderService,
IContentService contentService,
IIndexingService indexingService,
ISearchService searchService,
IAutomaticallyCuratePackageCommand autoCuratePackage,
IStatusService statusService,
IAppConfiguration config)
{
EntitiesContext = entitiesContext;
PackageService = packageService;
PackageFileService = packageFileService;
UserService = userService;
NugetExeDownloaderService = nugetExeDownloaderService;
ContentService = contentService;
StatisticsService = null;
IndexingService = indexingService;
SearchService = searchService;
AutoCuratePackage = autoCuratePackage;
StatusService = statusService;
_config = config;
}
示例6: PackagesController
public PackagesController(
IPackageService packageService,
IUploadFileService uploadFileService,
IUserService userService,
IMessageService messageService,
ISearchService searchService,
IAutomaticallyCuratePackageCommand autoCuratedPackageCmd,
INuGetExeDownloaderService nugetExeDownloaderService,
IPackageFileService packageFileService,
IEntitiesContext entitiesContext,
IAppConfiguration config,
IIndexingService indexingService,
ICacheService cacheService)
{
_packageService = packageService;
_uploadFileService = uploadFileService;
_userService = userService;
_messageService = messageService;
_searchService = searchService;
_autoCuratedPackageCmd = autoCuratedPackageCmd;
_nugetExeDownloaderService = nugetExeDownloaderService;
_packageFileService = packageFileService;
_entitiesContext = entitiesContext;
_config = config;
_indexingService = indexingService;
_cacheService = cacheService;
}
示例7: AuthenticationController
public AuthenticationController(
IFormsAuthenticationService formsAuthSvc,
IUserService userSvc)
{
this.formsAuthSvc = formsAuthSvc;
this.userSvc = userSvc;
}
示例8: UsersController
public UsersController(
ScimServerConfiguration serverConfiguration,
IUserService userService)
: base(serverConfiguration)
{
_UserService = userService;
}
示例9: UserModule
public UserModule(IUserService userService):base("/users")
{
Get["/{id}", true] = async (ctx, cancel) =>
{
var request = this.Bind<GetUserByIdRequest>();
var user = await userService.GetUserById(new GetUserById()
{
Id = request.Id
});
return Response.AsJson(user);
};
Post["/", true] = async (ctx, cancel) =>
{
var request = this.Bind<CreateUserRequest>();
var user = await userService.CreateUser(new CreateUser()
{
HourlyRate = request.HourlyRate,
Salary = request.Salary
});
return Response.AsJson(user);
};
}
示例10: UserController
public UserController(IUserRepository userRepository
, IUserService userService
)
{
_userRepository = userRepository;
_userService = userService;
}
示例11: MemberController
public MemberController(IMemberService memberService, IUserService userService, IRoleService roleService, ILevelService levelService)
{
_memberService = memberService;
_userService = userService;
_roleService = roleService;
_levelService = levelService;
}
示例12: UserRoleController
public UserRoleController(CoreSettings coreSettings, IPermissionService permissionService, IUserService userService, IWorkContext workContext)
{
_coreSettings = coreSettings;
_permissionService = permissionService;
_userService = userService;
_workContext = workContext;
}
示例13: SetUp
public void SetUp()
{
// you have to be an administrator to access the product controller
Thread.CurrentPrincipal = new GenericPrincipal(new GenericIdentity("admin"), new[] { "Administrator" });
categoryRepository = MockRepositoryBuilder.CreateCategoryRepository();
productRepository = MockRepositoryBuilder.CreateProductRepository();
productOrderableService = MockRepository.GenerateStub<IOrderableService<ProductCategory>>();
MockRepository.GenerateStub<IOrderableService<ProductImage>>();
userService = MockRepository.GenerateStub<IUserService>();
productBuilder = MockRepository.GenerateStub<IProductBuilder>();
productController = new ProductController(
productRepository,
categoryRepository,
productOrderableService,
userService,
MockRepository.GenerateStub<IUnitOfWorkManager>(),
productBuilder);
userService.Stub(c => c.CurrentUser).Return(new User { Role = Role.Administrator });
}
示例14: DepartmentSelectorView
public DepartmentSelectorView(IApplicationStateSetter applicationStateSetter, IApplicationState applicationState,
IUserService userService, ICacheService cacheService)
{
InitializeComponent();
_applicationStateSetter = applicationStateSetter;
DataContext = new DepartmentSelectorViewModel(applicationState, _applicationStateSetter, userService, cacheService);
}
示例15: CreateTokenRequestValidator
//public static ClientValidator CreateClientValidator(
// IClientStore clients = null,
// IClientSecretValidator secretValidator = null)
//{
// if (clients == null)
// {
// clients = new InMemoryClientStore(ClientValidationTestClients.Get());
// }
// if (secretValidator == null)
// {
// secretValidator = new HashedClientSecretValidator();
// }
// var owin = new OwinEnvironmentService(new OwinContext());
// return new ClientValidator(clients, secretValidator, owin);
//}
public static TokenRequestValidator CreateTokenRequestValidator(
IdentityServerOptions options = null,
IScopeStore scopes = null,
IAuthorizationCodeStore authorizationCodeStore = null,
IRefreshTokenStore refreshTokens = null,
IUserService userService = null,
IEnumerable<ICustomGrantValidator> customGrantValidators = null,
ICustomRequestValidator customRequestValidator = null,
ScopeValidator scopeValidator = null)
{
if (options == null)
{
options = TestIdentityServerOptions.Create();
}
if (scopes == null)
{
scopes = new InMemoryScopeStore(TestScopes.Get());
}
if (userService == null)
{
userService = new TestUserService();
}
if (customRequestValidator == null)
{
customRequestValidator = new DefaultCustomRequestValidator();
}
CustomGrantValidator aggregateCustomValidator;
if (customGrantValidators == null)
{
aggregateCustomValidator = new CustomGrantValidator(new [] { new TestGrantValidator() });
}
else
{
aggregateCustomValidator = new CustomGrantValidator(customGrantValidators);
}
if (refreshTokens == null)
{
refreshTokens = new InMemoryRefreshTokenStore();
}
if (scopeValidator == null)
{
scopeValidator = new ScopeValidator(scopes);
}
return new TokenRequestValidator(
options,
authorizationCodeStore,
refreshTokens,
userService,
aggregateCustomValidator,
customRequestValidator,
scopeValidator,
new DefaultEventService());
}