66using System . Linq . Expressions ;
77using System . Reflection ;
88
9- namespace BootstrapBlazor . Components ;
9+ namespace BootstrapBlazor . DataConverters ;
1010
1111/// <summary>
1212/// 数据转换器集合类
1313/// </summary>
14- public sealed class SocketDataConverterCollections
14+ public sealed class DataConverterCollections
1515{
16- readonly ConcurrentDictionary < Type , ISocketDataConverter > _converters = new ( ) ;
17- readonly ConcurrentDictionary < MemberInfo , SocketDataPropertyConverterAttribute > _propertyConverters = new ( ) ;
16+ readonly ConcurrentDictionary < Type , IDataConverter > _converters = new ( ) ;
17+ readonly ConcurrentDictionary < MemberInfo , DataPropertyConverterAttribute > _propertyConverters = new ( ) ;
1818
1919 /// <summary>
20- /// 增加指定 <see cref="ISocketDataConverter {TEntity}"/> 数据类型转换器方法
20+ /// 增加指定 <see cref="IDataConverter {TEntity}"/> 数据类型转换器方法
2121 /// </summary>
2222 /// <typeparam name="TEntity"></typeparam>
2323 /// <param name="converter"></param>
24- public void AddTypeConverter < TEntity > ( ISocketDataConverter < TEntity > converter )
24+ public void AddTypeConverter < TEntity > ( IDataConverter < TEntity > converter )
2525 {
2626 var type = typeof ( TEntity ) ;
2727 _converters . AddOrUpdate ( type , t => converter , ( t , v ) => converter ) ;
2828 }
2929
3030 /// <summary>
31- /// 增加默认数据类型转换器方法 转换器使用 <see cref="SocketDataConverter {TEntity}"/>
31+ /// 增加默认数据类型转换器方法 转换器使用 <see cref="DataConverter {TEntity}"/>
3232 /// </summary>
3333 /// <typeparam name="TEntity"></typeparam>
34- public void AddTypeConverter < TEntity > ( ) => AddTypeConverter ( new SocketDataConverter < TEntity > ( this ) ) ;
34+ public void AddTypeConverter < TEntity > ( ) => AddTypeConverter ( new DataConverter < TEntity > ( this ) ) ;
3535
3636 /// <summary>
3737 /// 添加属性类型转化器方法
3838 /// </summary>
3939 /// <typeparam name="TEntity"></typeparam>
4040 /// <param name="propertyExpression"></param>
4141 /// <param name="attribute"></param>
42- public void AddPropertyConverter < TEntity > ( Expression < Func < TEntity , object ? > > propertyExpression , SocketDataPropertyConverterAttribute attribute )
42+ public void AddPropertyConverter < TEntity > ( Expression < Func < TEntity , object ? > > propertyExpression , DataPropertyConverterAttribute attribute )
4343 {
4444 if ( propertyExpression . Body is MemberExpression memberExpression )
4545 {
@@ -55,11 +55,11 @@ public void AddPropertyConverter<TEntity>(Expression<Func<TEntity, object?>> pro
5555 /// 获得指定数据类型转换器方法
5656 /// </summary>
5757 /// <typeparam name="TEntity"></typeparam>
58- public bool TryGetTypeConverter < TEntity > ( [ NotNullWhen ( true ) ] out ISocketDataConverter < TEntity > ? converter )
58+ public bool TryGetTypeConverter < TEntity > ( [ NotNullWhen ( true ) ] out IDataConverter < TEntity > ? converter )
5959 {
6060 converter = null ;
6161 var ret = false ;
62- if ( _converters . TryGetValue ( typeof ( TEntity ) , out var v ) && v is ISocketDataConverter < TEntity > c )
62+ if ( _converters . TryGetValue ( typeof ( TEntity ) , out var v ) && v is IDataConverter < TEntity > c )
6363 {
6464 converter = c ;
6565 ret = true ;
@@ -71,7 +71,7 @@ public bool TryGetTypeConverter<TEntity>([NotNullWhen(true)] out ISocketDataConv
7171 /// 获得指定数据类型属性转换器方法
7272 /// </summary>
7373 /// <typeparam name="TEntity"></typeparam>
74- public bool TryGetPropertyConverter < TEntity > ( Expression < Func < TEntity , object ? > > propertyExpression , [ NotNullWhen ( true ) ] out SocketDataPropertyConverterAttribute ? converterAttribute )
74+ public bool TryGetPropertyConverter < TEntity > ( Expression < Func < TEntity , object ? > > propertyExpression , [ NotNullWhen ( true ) ] out DataPropertyConverterAttribute ? converterAttribute )
7575 {
7676 converterAttribute = null ;
7777 var ret = false ;
@@ -87,7 +87,7 @@ public bool TryGetPropertyConverter<TEntity>(Expression<Func<TEntity, object?>>
8787 /// 获得指定数据类型属性转换器方法
8888 /// </summary>
8989 /// <typeparam name="TEntity"></typeparam>
90- public bool TryGetPropertyConverter < TEntity > ( MemberInfo memberInfo , [ NotNullWhen ( true ) ] out SocketDataPropertyConverterAttribute ? converterAttribute )
90+ public bool TryGetPropertyConverter < TEntity > ( MemberInfo memberInfo , [ NotNullWhen ( true ) ] out DataPropertyConverterAttribute ? converterAttribute )
9191 {
9292 converterAttribute = null ;
9393 var ret = false ;
0 commit comments