According to CA1062 null checks are required in externally visible methods like this:
public static double GetLongitude(this Location location)
{
if(location is null)
{
throw new ArgumentNullException(nameof(location));
}
return location.Longitude;
}
I have now updated to .net 6.0 and tried to use the parameter null check ":!":
public static double GetLongitude(this Location location!!) => location.Longitude;
But this thrown CA1062 again.
Hope you guys can help me:-)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.