Example #1
0
        public virtual async Task <IdentityClaimTypeDto> CreateAsync(IdentityClaimTypeCreateDto input)
        {
            if (await IdentityClaimTypeRepository.AnyAsync(input.Name))
            {
                throw new UserFriendlyException(L["IdentityClaimTypeAlreadyExists", input.Name]);
            }
            var identityClaimType = new IdentityClaimType(
                GuidGenerator.Create(),
                input.Name,
                input.Required,
                input.IsStatic,
                input.Regex,
                input.RegexDescription,
                input.Description,
                input.ValueType
                );

            identityClaimType = await IdenityClaimTypeManager.CreateAsync(identityClaimType);

            await CurrentUnitOfWork.SaveChangesAsync();

            return(ObjectMapper.Map <IdentityClaimType, IdentityClaimTypeDto>(identityClaimType));
        }
 public virtual async Task <IdentityClaimTypeDto> CreateAsync(IdentityClaimTypeCreateDto input)
 {
     return(await IdentityClaimTypeAppService.CreateAsync(input));
 }