示例#1
0
        /// <summary>
        /// 转换为资源持久化对象
        /// </summary>
        public static ResourcePo ToPo(this IdentityResource entity)
        {
            if (entity == null)
            {
                return(null);
            }
            var result = entity.MapTo <ResourcePo>();

            result.Type   = ResourceType.Identity;
            result.Extend = Json.ToJson(CreateExtend(entity));
            return(result);
        }
示例#2
0
 /// <summary>
 /// 创建身份资源扩展对象
 /// </summary>
 private static IdentityResourceExtend CreateExtend(IdentityResource entity)
 {
     return(entity.MapTo <IdentityResourceExtend>());
 }