コード例 #1
0
 /// <summary>
 /// 附加上模型特性实例。
 /// </summary>
 /// <typeparam name="TModelUIAttribute">模型特性类型。</typeparam>
 /// <typeparam name="TModel">模型类型。</typeparam>
 /// <param name="builder">服务构建实例对象。</param>
 /// <returns>返回服务构建实例对象。</returns>
 public static IServiceBuilder AddModelUI <TModelUIAttribute, TModel>(this IServiceBuilder builder)
     where TModel : class
     where TModelUIAttribute : ModelUIAttribute
 {
     return(builder.AddModelUI <TModelUIAttribute, TModel>((pcc, c) => pcc.Add(c)));
 }
コード例 #2
0
 /// <summary>
 /// 附加上用户模型特性实例。
 /// </summary>
 /// <typeparam name="TUser">模型类型。</typeparam>
 /// <param name="builder">服务构建实例对象。</param>
 /// <returns>返回服务构建实例对象。</returns>
 public static IServiceBuilder AddModelUI <TUser>(this IServiceBuilder builder)
     where TUser : class, IUser
 {
     return(builder.AddModelUI <TUserModelUIAttribute, TUser>((pcc, c) => pcc.Add(c)));
 }