예제 #1
0
        public async Task <IdentityResult> UpdateAsync(TRole role, CancellationToken cancellationToken)
        {
            var update = new IdRole(role.Id, role.Name, role.NameNormalized, Unique.String());
            var result = await RoleStore.Ask(new RoleCommands.Update(update), TimeSpan.FromSeconds(_StandardTimeoutSeconds), cancellationToken);

            return(new IdentityResult());
        }
예제 #2
0
 public async Task <string> GetUserIdAsync(TUser user, CancellationToken cancellationToken)
 {
     if (user != null && !string.IsNullOrEmpty(user.Id))
     {
         return(await Task.Run(() => user.Id));
     }
     else
     {
         return(Unique.String());
     }
 }
예제 #3
0
        private void GetEntityTypeCmd(GetEntityType cmd)
        {
            EntityType entityType;

            if (State.EntityTypes.ContainsKey(cmd.Type))
            {
                entityType = new EntityType(State.EntityTypes[cmd.Type], cmd.Type);
                SendEntityTypeResult(entityType);
            }
            else
            {
                entityType = new EntityType(Unique.String(), cmd.Type);
                EntityTypeCreated evnt = new EntityTypeCreated(entityType);
                PersistAndTrack(evnt, result =>
                {
                    EntityTypeCreatedEvnt(evnt);
                    SendEntityTypeResult(entityType);
                });
            }
        }
예제 #4
0
파일: Path.cs 프로젝트: mattbragaw/mqb
 public static string GetUniqueName(string baseType)
 {
     return(string.Format("{0}-{1}", baseType, Unique.String()));
 }