当前位置: 首页>>代码示例>>C#>>正文


C# UserId类代码示例

本文整理汇总了C#中UserId的典型用法代码示例。如果您正苦于以下问题:C# UserId类的具体用法?C# UserId怎么用?C# UserId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


UserId类属于命名空间,在下文中一共展示了UserId类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Authorize

 public void Authorize(UserId user, object message)
 {
     var decider = GetDeciderForMessage(user);
       if (!decider.AreAllAllowed(_resolver.ResolvePermission(message))) {
     throw new SecurityException(string.Format("Yo bro, u do not have permission to {0}", message.GetType().Name.ToLowerInvariant()));
       }
 }
开发者ID:yreynhout,项目名称:NAuthorize,代码行数:7,代码来源:MessageAuthorizer.cs

示例2: GetUserTimeline

		public static IObservable<StatusCollection> GetUserTimeline(
			this TwitterAccount account,
			UserId? userId = null,
			int? count = null,
			StatusId? sinceId = null,
			StatusId? maxId = null,
			bool? trimUser = null,
			bool? excludeReplies = null,
			bool? contributorDetails = null,
			bool? includeRts = null,
			bool isStartup = false)
		{
			const string endpoint = "statuses/user_timeline";
			var source = isStartup
				? StatusSource.RestApi | StatusSource.Startup
				: StatusSource.RestApi;
			var client = account.ToOAuthClient(endpoint);

			if (userId.HasValue) client.Parameters.Add("user_id", userId.Value);
			if (count.HasValue) client.Parameters.Add("count", count.Value);
			if (sinceId.HasValue) client.Parameters.Add("since_id", sinceId.Value);
			if (maxId.HasValue) client.Parameters.Add("max_id", maxId.Value);
			if (trimUser.HasValue) client.Parameters.Add("trim_user", trimUser.Value);
			if (excludeReplies.HasValue) client.Parameters.Add("exclude_replies", excludeReplies.Value);
			if (contributorDetails.HasValue) client.Parameters.Add("contributor_details", contributorDetails.Value);
			if (includeRts.HasValue) client.Parameters.Add("include_rts", includeRts.Value);

			return Observable
				.Defer(client.GetResponseText)
				.Select(json => StatusCollection.Parse(json, source))
				.OnErrorRetry(3)
				.WriteLine(endpoint);
		}
开发者ID:Grabacr07,项目名称:Mukyutter.Old,代码行数:33,代码来源:RestApi_Timelines.cs

示例3: Invite

 public Invite(string email, string displayName, UserId userId, string token)
 {
     Email = email;
     DisplayName = displayName;
     FutureUserId = userId;
     FutureToken = token;
 }
开发者ID:mojamcpds,项目名称:lokad-cqrs-1,代码行数:7,代码来源:SecurityState.cs

示例4: GetUser

            public User GetUser(UserId userId)
            {
                Guard.IsTrue("userId", () => userId.ToString().Length>0);

                var request = AsanaRequest.Get(string.Format("users/{0}", userId));
                return ExecuteRequest<User>(request);
            }
开发者ID:pocheptsov,项目名称:nasana,代码行数:7,代码来源:AsanaClient.User.cs

示例5: Create

        public void Create(UserId userId, SecurityId securityId)
        {
            if (_state.Version != 0)
                throw new DomainError("User already has non-zero version");

            Apply(new UserCreated(userId, securityId, DefaultLoginActivityThreshold));
        }
开发者ID:AGiorgetti,项目名称:lokad-cqrs,代码行数:7,代码来源:UserAggregate.cs

示例6: GetDeciderForMessage

 IAccessDecider GetDeciderForMessage(UserId userId)
 {
     var combinator = new AccessDecisionCombinator();
       var user = _userRepository.Get(userId);
       user.CombineDecisions(combinator, _roleRepository);
       return combinator.BuildDecider();
 }
开发者ID:yreynhout,项目名称:NAuthorize,代码行数:7,代码来源:MessageAuthorizer.cs

示例7: PerformIdentityAuth

        public AuthenticationResult PerformIdentityAuth(string identity)
        {
            long userId;
            var logins = _webEndpoint.GetSingleton<LoginsIndexView>().Identities;
            if (!logins.TryGetValue(identity, out userId))
            {
                // login not found
                return AuthenticationResult.UnknownIdentity;
            }
            var id = new UserId(userId);

            var maybe = _webEndpoint.GetView<LoginView>(id);

            if (!maybe.HasValue)
            {
                // we haven't created view, yet
                return AuthenticationResult.UnknownIdentity;
            }

            var view = maybe.Value;

            // ok, the view is locked.
            if (view.LockedOutTillUtc > DateTime.UtcNow.AddSeconds(2))
            {
                return new AuthenticationResult(ComposeLockoutMessage(view));
            }

            // direct conversion, will be updated to hashes

            ReportLoginSuccess(id, view);
            return ViewToResult(id, view);
        }
开发者ID:syned,项目名称:lokad-cqrs-appharbor,代码行数:32,代码来源:WebAuth.cs

示例8:

		public List this[ListId id, UserId ownerId]
		{
			get
			{
				var key = Tuple.Create(id, ownerId);
				return this.DoReadLockAction(() => this.lists.ContainsKey(key) ? this.lists[key] : null);
			}
		}
开发者ID:Grabacr07,项目名称:Mukyutter.Old,代码行数:8,代码来源:ListStore.cs

示例9: AddIdentity

 public void AddIdentity(IDomainIdentityService ids, PasswordGenerator pwds, string display, string identity)
 {
     if (_state.ContainsIdentity(identity))
         return;
     var user = new UserId(ids.GetId());
     var token = pwds.CreateToken();
     Apply(new SecurityIdentityAdded(_state.Id, user, display, identity, token));
 }
开发者ID:mojamcpds,项目名称:lokad-cqrs-1,代码行数:8,代码来源:SecurityAggregate.cs

示例10: SetFallbackToken

		public void SetFallbackToken(UserId userId, Guid applicationId)
		{
			this.fallbackToken = null;
			this.FallbackUserId = userId;
			this.FallbackApplicationId = applicationId;

			this.RaisePropertyChanged("FallbackToken");
		}
开发者ID:Grabacr07,项目名称:Mukyutter.Old,代码行数:8,代码来源:TwitterToken.cs

示例11: User

 public User(InMemoryDomainEvents domainEvents, UserId id, string name, string email)
     : base(domainEvents)
 {
     Id = id;
     Name = name;
     _email = email;
     TryRaiseEvent(new UserCreated() { UserId = Id, UserName = Name, UserEmail = Email, Version = Version });
 }
开发者ID:dgmachado,项目名称:EventSourcingAndCQRSLib,代码行数:8,代码来源:User.cs

示例12: UpdateLogin

 public void UpdateLogin(UserId id, DateTime timeUtc)
 {
     var item = Items[id.Id];
     if (item.LastLoginUtc < timeUtc)
     {
         item.LastLoginUtc = timeUtc;
     }
 }
开发者ID:JeetKunDoug,项目名称:lokad-cqrs,代码行数:8,代码来源:SecurityView.cs

示例13: ShowListCore

		private static IObservable<List> ShowListCore(OAuthClient client, string endpoint, UserId ownerId)
		{
			return Observable
				.Defer(() => client.GetResponseText())
				.Select(json => List.Parse(json, ownerId))
				.OnErrorRetry(3)
				.WriteLine(endpoint, list => list.FullName);
		}
开发者ID:Grabacr07,项目名称:Mukyutter.Old,代码行数:8,代码来源:RestApi_Lists.cs

示例14: VkontakteLogin

        public ActionResult VkontakteLogin(string uid, string firstName, string lastName, string photo, string returnUrl)
        {
            var userId = new UserId(uid);
            _bus.Send(new ReportUserLoggedIn(userId, firstName + " " + lastName, photo));

            FormsAuthentication.SetAuthCookie(uid, true);
            return SuccessfullLoginRedirect(returnUrl);
        }
开发者ID:AlexSugak,项目名称:EComWithCQRS,代码行数:8,代码来源:AccountController.cs

示例15: SetUserEmailIfNeeded

        private void SetUserEmailIfNeeded(UserId userId, EmailAddress email)
        {
            UserDetails userDetails = _readModel.GetUserDetails(userId);

            if (String.IsNullOrWhiteSpace(userDetails.Email))
            {
                _bus.Send(new SetUserEmail(userId, email));
            }
        }
开发者ID:MaximShishov,项目名称:EComWithCQRS,代码行数:9,代码来源:AccountController.cs


注:本文中的UserId类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。