本文整理汇总了C#中IUserRepository类的典型用法代码示例。如果您正苦于以下问题:C# IUserRepository类的具体用法?C# IUserRepository怎么用?C# IUserRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IUserRepository类属于命名空间,在下文中一共展示了IUserRepository类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AccountController
public AccountController(IFormsAuthentication formsAuthentication,
IUserRepository users, ICommandSender cmds)
{
_formsAuthentication = formsAuthentication;
_users = users;
_cmds = cmds;
}
示例2: SessionManager
/// <summary>
/// Initializes a new instance of the <see cref="SessionManager"/> class.
/// </summary>
/// <param name="userDataRepository">The user data repository.</param>
/// <param name="configurationManager">The configuration manager.</param>
/// <param name="logger">The logger.</param>
/// <param name="userRepository">The user repository.</param>
public SessionManager(IUserDataRepository userDataRepository, IServerConfigurationManager configurationManager, ILogger logger, IUserRepository userRepository)
{
_userDataRepository = userDataRepository;
_configurationManager = configurationManager;
_logger = logger;
_userRepository = userRepository;
}
示例3: GroupsService
public GroupsService(IGroupsRepository groupsRepository, IUserRepository userRepository, IAppConfigurationProvider configurationProvider, ITasksService tasksService)
{
_groupsRepository = groupsRepository;
_userRepository = userRepository;
_tasksService = tasksService;
_configurationProvider = configurationProvider;
}
示例4: MenuViewModel
public MenuViewModel(IUserRepository userRepository)
{
if (userRepository == null)
throw new ArgumentNullException("userRepository");
_userRepository = userRepository;
Menu = new ReactiveList<MenuOptionViewModel>();
// Use WhenAny to observe one or more values
var canLoadMenu = this.WhenAny(m => m.User, user => user.Value != null);
// hook function to command, shouldn't contain UI/complex logic
LoadMenu = ReactiveCommand.CreateAsyncTask(canLoadMenu, _ => _userRepository.GetMenuByUser(User));
// RxApp.MainThreadScheduler is our UI thread, you can go wild here
LoadMenu.ObserveOn(RxApp.MainThreadScheduler).Subscribe(menu =>
{
Menu.Clear();
foreach (var option in menu)
{
var menuOption = new MenuOptionViewModel(option);
Menu.Add(menuOption);
}
});
LoadMenu.ThrownExceptions.Subscribe(ex =>
{
Menu.Clear();
MessageBox.Show(ex.Message);
});
// Use WhenAnyValue to check if a property was changed
// If user was changed reload menu
this.WhenAnyValue(m => m.User).InvokeCommand(this, vm => vm.LoadMenu);
}
示例5: verify_receive_appropriate_error_message_when_user_provides_a_bad_user_name_or_password
public void verify_receive_appropriate_error_message_when_user_provides_a_bad_user_name_or_password()
{
AuthenticationStatus authStatus = null;
Story authenticateUserStory = new Story("Authenticate User");
authenticateUserStory.AsA("Unauthenticated user")
.IWant("supply my user name and password to the login form")
.SoThat("I can authenticate to the application");
authenticateUserStory
.WithScenario("User provides an invalid user name")
.Given("My user name and password are ", "Big Daddy", "Gobldegook", delegate(string userName, string password) { UserRepositoryFactory factory = _mock.DynamicMock<UserRepositoryFactory>();
using (_mock.Record())
{
Expect.Call(factory.Create(userName, password))
.Return(_mock.DynamicMock<IUserRepository>());
}
_user = factory.Create(userName, password); })
.When("I authenticate the user", delegate {_service = _mock.DynamicMock<IAuthenticationService>();
using (_mock.Record())
{
Expect.Call(_service.Authenticate(_user))
.Return(new AuthenticationStatus(new Exception("Bad Username or Password")));
}
authStatus = _service.Authenticate(_user);})
.Then("I should receive an Authentication status of", Status.Failed, delegate(Status expectedStatus) {Assert.AreEqual(expectedStatus, authStatus.Status);});
}
示例6: UserService
public UserService(IUserRepository userRepository, IUserInfoRepository userInfoRepository, IUserPreferencesRepository userPreferencesRepository, IUnitOfWork unitOfWork)
{
_userRepository = userRepository;
_userInfoRepository = userInfoRepository;
_userPreferencesRepository = userPreferencesRepository;
_unitOfWork = unitOfWork;
}
示例7: IdeaController
public IdeaController(IIdeaRepository ideas, IUserRepository users, ISettingsRepository settings, IImageRepository imageRepository, IFeatureRepository features)
{
_ideas = ideas;
_users = users;
_settings = settings;
_features = features;
}
示例8: WikiExporter
public WikiExporter(ApplicationSettings applicationSettings, PageService pageService, ISettingsRepository settingsRepository, IPageRepository pageRepository, IUserRepository userRepository, IPluginFactory pluginFactory)
{
if (applicationSettings == null)
throw new ArgumentNullException(nameof(applicationSettings));
if (pageService == null)
throw new ArgumentNullException(nameof(pageService));
if (settingsRepository == null)
throw new ArgumentNullException(nameof(settingsRepository));
if (pageRepository == null)
throw new ArgumentNullException(nameof(pageRepository));
if (userRepository == null)
throw new ArgumentNullException(nameof(userRepository));
if (pluginFactory == null)
throw new ArgumentNullException(nameof(pluginFactory));
_applicationSettings = applicationSettings;
_pageService = pageService;
_sqlExportBuilder = new SqlExportBuilder(settingsRepository, userRepository, pageRepository, pluginFactory);
ExportFolder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "App_Data", "Export");
}
示例9: SetUp
public void SetUp()
{
blogRP = MockRepository.GenerateMock<IBlogRepository>();
postRP = MockRepository.GenerateMock<IPostRepository>();
userRP = MockRepository.GenerateMock<IUserRepository>();
friendlyUrlGen = MockRepository.GenerateMock<IFriendlyUrlGenerator>();
}
示例10: GetCurrentUser
public static User GetCurrentUser(this NancyContext context, IUserRepository _users)
{
if (context == null || context.CurrentUser == null || string.IsNullOrWhiteSpace(context.CurrentUser.UserName))
return null;
return _users.FindBy(u => u.UserName == context.CurrentUser.UserName).FirstOrDefault();
}
示例11: ImageBrowserController
public ImageBrowserController(IInvestContext investContext, IUserRepository userRepository)
{
this.directoryBrowser = new DirectoryBrowser();
this.thumbnailCreator = new ThumbnailCreator();
this._investContext = investContext;
this._userRepository = userRepository;
}
示例12: UserManager
/// <summary>
/// Initializes a new instance of the <see cref="UserManager" /> class.
/// </summary>
/// <param name="logger">The logger.</param>
/// <param name="configurationManager">The configuration manager.</param>
/// <param name="userRepository">The user repository.</param>
public UserManager(ILogger logger, IServerConfigurationManager configurationManager, IUserRepository userRepository)
{
_logger = logger;
UserRepository = userRepository;
ConfigurationManager = configurationManager;
Users = new List<User>();
}
示例13: AllowAuthorAttribute
public AllowAuthorAttribute()
{
isAccess = false;
_userRepository = DependencyResolver.Current.GetService<IUserRepository>();
_articleRepository = DependencyResolver.Current.GetService<IArticleRepository>();
}
示例14: TopicsController
public TopicsController(ITopicsRepository topicsRepository,
IChaptersRepository chaptersRepository, IUserRepository userRepository)
{
ChaptersRepository = chaptersRepository;
UserRepository = userRepository;
TopicsRepository = topicsRepository;
}
示例15: TenantProvisioningService
public TenantProvisioningService(ITenantRepository tenantRepository, IUserRepository userRepository,
IRoleRepository roleRepository)
{
this._tenantRepository = tenantRepository;
this._userRepository = userRepository;
this._roleRepository = roleRepository;
}