refactor: Search(uint) 方法标记过期
This commit is contained in:
parent
613501fc00
commit
0b3d794738
|
|
@ -30,6 +30,7 @@ public interface ISearcher
|
||||||
/// 搜索方法 仅限 IPv4 使用
|
/// 搜索方法 仅限 IPv4 使用
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="ipAddress">IPv4 地址字节数组小端读取 uint 数值</param>
|
/// <param name="ipAddress">IPv4 地址字节数组小端读取 uint 数值</param>
|
||||||
|
[Obsolete("已弃用,请改用其他方法;Deprecated; please use Search(string) or Search(IPAddress) method.")]
|
||||||
string? Search(uint ipAddress);
|
string? Search(uint ipAddress);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ using IP2Region.Net.Abstractions;
|
||||||
using IP2Region.Net.Internal;
|
using IP2Region.Net.Internal;
|
||||||
using IP2Region.Net.Internal.Abstractions;
|
using IP2Region.Net.Internal.Abstractions;
|
||||||
using System.Buffers.Binary;
|
using System.Buffers.Binary;
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
|
|
@ -47,14 +48,13 @@ public class Searcher : ISearcher
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? Search(IPAddress ipAddress)
|
public string? Search(IPAddress ipAddress) => SearchCore(ipAddress.GetAddressBytes());
|
||||||
{
|
|
||||||
return SearchCore(ipAddress.GetAddressBytes());
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Obsolete("已弃用,请改用其他方法;Deprecated; please use Search(string) or Search(IPAddress) method.")]
|
||||||
|
[ExcludeFromCodeCoverage]
|
||||||
public string? Search(uint ipAddress)
|
public string? Search(uint ipAddress)
|
||||||
{
|
{
|
||||||
var bytes = BitConverter.GetBytes(ipAddress);
|
var bytes = BitConverter.GetBytes(ipAddress);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue