コード例 #1
0
        protected virtual IUserStateCreated Map(ICreateUser c)
        {
            var stateEventId    = new UserEventId(c.UserId, c.Version);
            IUserStateCreated e = NewUserStateCreated(stateEventId);

            e.UserName             = c.UserName;
            e.AccessFailedCount    = c.AccessFailedCount;
            e.Email                = c.Email;
            e.EmailConfirmed       = c.EmailConfirmed;
            e.LockoutEnabled       = c.LockoutEnabled;
            e.LockoutEndDateUtc    = c.LockoutEndDateUtc;
            e.PasswordHash         = c.PasswordHash;
            e.PhoneNumber          = c.PhoneNumber;
            e.PhoneNumberConfirmed = c.PhoneNumberConfirmed;
            e.TwoFactorEnabled     = c.TwoFactorEnabled;
            e.SecurityStamp        = c.SecurityStamp;
            e.Active               = c.Active;
            e.CommandId            = c.CommandId;


            e.CreatedBy = (string)c.RequesterId;
            e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>();
            var version = c.Version;

            foreach (ICreateUserRole innerCommand in c.UserRoles)
            {
                ThrowOnInconsistentCommands(c, innerCommand);

                IUserRoleStateCreated innerEvent = MapCreate(innerCommand, c, version, _state);
                e.AddUserRoleEvent(innerEvent);
            }

            foreach (ICreateUserClaim innerCommand in c.UserClaims)
            {
                ThrowOnInconsistentCommands(c, innerCommand);

                IUserClaimStateCreated innerEvent = MapCreate(innerCommand, c, version, _state);
                e.AddUserClaimEvent(innerEvent);
            }

            foreach (ICreateUserPermission innerCommand in c.UserPermissions)
            {
                ThrowOnInconsistentCommands(c, innerCommand);

                IUserPermissionStateCreated innerEvent = MapCreate(innerCommand, c, version, _state);
                e.AddUserPermissionEvent(innerEvent);
            }

            foreach (ICreateUserLogin innerCommand in c.UserLogins)
            {
                ThrowOnInconsistentCommands(c, innerCommand);

                IUserLoginStateCreated innerEvent = MapCreate(innerCommand, c, version, _state);
                e.AddUserLoginEvent(innerEvent);
            }


            return(e);
        }
コード例 #2
0
        protected UserStateDeleted NewUserStateDeleted(long version, string commandId, string requesterId)
        {
            var stateEventId = new UserEventId(_state.UserId, version);
            var e            = NewUserStateDeleted(stateEventId);

            e.CommandId = commandId;

            e.CreatedBy = (string)requesterId;
            e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>();

            return(e);
        }
コード例 #3
0
        protected virtual IUserStateDeleted Map(IDeleteUser c)
        {
            var stateEventId    = new UserEventId(c.UserId, c.Version);
            IUserStateDeleted e = NewUserStateDeleted(stateEventId);

            e.CommandId = c.CommandId;


            e.CreatedBy = (string)c.RequesterId;
            e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>();


            return(e);
        }
コード例 #4
0
        public override bool Equals(object obj)
        {
            if (Object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            UserEventId other = obj as UserEventId;

            if (other == null)
            {
                return(false);
            }

            return(true &&
                   Object.Equals(this.UserId, other.UserId) &&
                   Object.Equals(this.Version, other.Version)
                   );
        }
コード例 #5
0
 private UserStateDeleted NewUserStateDeleted(UserEventId stateEventId)
 {
     return(new UserStateDeleted(stateEventId));
 }
コード例 #6
0
 private UserStateMergePatched NewUserStateMergePatched(UserEventId stateEventId)
 {
     return(new UserStateMergePatched(stateEventId));
 }
コード例 #7
0
ファイル: UserStateEventDto.cs プロジェクト: uwitec/wms-8
 protected UserStateEventDtoBase(UserEventId stateEventId)
 {
     this.UserEventId = stateEventId;
 }
コード例 #8
0
ファイル: UserEvent.cs プロジェクト: uwitec/wms-8
 public UserStateDeleted(UserEventId stateEventId) : base(stateEventId)
 {
 }
コード例 #9
0
ファイル: UserEvent.cs プロジェクト: uwitec/wms-8
 public UserStateMergePatched(UserEventId stateEventId) : base(stateEventId)
 {
 }
コード例 #10
0
ファイル: UserEvent.cs プロジェクト: uwitec/wms-8
 public UserStateCreated(UserEventId stateEventId) : base(stateEventId)
 {
 }
コード例 #11
0
ファイル: UserEvent.cs プロジェクト: uwitec/wms-8
 protected UserStateEventBase(UserEventId stateEventId) : base(stateEventId)
 {
 }