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()); }
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()); } }
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); }); } }
public static string GetUniqueName(string baseType) { return(string.Format("{0}-{1}", baseType, Unique.String())); }