File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ public BaseDataTable()
8686 /// </summary>
8787 /// <param name="id">对象的ID</param>
8888 /// <returns>找到的对象,如果未找到则返回默认值</returns>
89+ [ Obsolete ( "请使用 TryGet 方法替代" ) ]
8990 public T Get ( int id )
9091 {
9192 LongDataMaps . TryGetValue ( id , out var value ) ;
@@ -97,6 +98,7 @@ public T Get(int id)
9798 /// </summary>
9899 /// <param name="id">对象的ID</param>
99100 /// <returns>找到的对象,如果未找到则返回默认值</returns>
101+ [ Obsolete ( "请使用 TryGet 方法替代" ) ]
100102 public T Get ( long id )
101103 {
102104 LongDataMaps . TryGetValue ( id , out var value ) ;
@@ -108,6 +110,7 @@ public T Get(long id)
108110 /// </summary>
109111 /// <param name="id">对象的ID</param>
110112 /// <returns>找到的对象,如果未找到则返回默认值</returns>
113+ [ Obsolete ( "请使用 TryGet 方法替代" ) ]
111114 public T Get ( string id )
112115 {
113116 StringDataMaps . TryGetValue ( id , out var value ) ;
Original file line number Diff line number Diff line change @@ -60,20 +60,23 @@ public interface IDataTable<T> : IDataTable
6060 /// </summary>
6161 /// <param name="id">要获取的对象的唯一整数标识符。</param>
6262 /// <returns>与指定 ID 关联的数据对象;如果未找到匹配项,则可能返回 null 或抛出异常(取决于实现)。</returns>
63+ [ Obsolete ( "请使用 TryGet 方法替代" ) ]
6364 T Get ( int id ) ;
6465
6566 /// <summary>
6667 /// 根据指定的长整数 ID 获取数据表中的对象。
6768 /// </summary>
6869 /// <param name="id">要获取的对象的唯一长整数标识符。</param>
6970 /// <returns>与指定 ID 关联的数据对象;如果未找到匹配项,则可能返回 null 或抛出异常(取决于实现)。</returns>
71+ [ Obsolete ( "请使用 TryGet 方法替代" ) ]
7072 T Get ( long id ) ;
7173
7274 /// <summary>
7375 /// 根据指定的字符串 ID 获取数据表中的对象。
7476 /// </summary>
7577 /// <param name="id">要获取的对象的唯一字符串标识符。</param>
7678 /// <returns>与指定 ID 关联的数据对象;如果未找到匹配项,则可能返回 null 或抛出异常(取决于实现)。</returns>
79+ [ Obsolete ( "请使用 TryGet 方法替代" ) ]
7780 T Get ( string id ) ;
7881
7982 /// <summary>
You can’t perform that action at this time.
0 commit comments