我想知道两个空间库有什么区别 - Microsoft.Spatial和System.Spatial?
当我查看这两个代码时,我看到几乎相同的类.两者都有例如GeographyPoint或Geography抽象类.与那些实施相同.
应该使用哪一个?
要添加更多的上下文 - 我正在使用一些地理空间功能进行Azure搜索.
所以我的数据库中有一个bool列,表示访问者是否是"Inhouse".如果值是,true我希望img src为:const string checkedIn = "/Images/Icons/Visitor-checkedin-16x16.png";if false,我希望它是另一个src.而且,如果访客尚未访问,"内部"应该是falseAND"预期到期"日期还没有.这是我的代码:
C#:
public string GetImageUrl(string inhouse, DateTime expectedArrival)
{
const string checkedIn = "/Images/Icons/Visitor-checkedin-16x16.png";
const string checkedOut = "/Images/Icons/Visitor-checkedout-16x16.png";
const string notArrived = "/Images/Icons/Visitor-notarrived-16x16.png";
if (ToBool(inhouse))
{
inhouse = checkedIn;
}
else if (ToBool(inhouse) == false && expectedArrival.AddDays(0) <= DateTime.Now)
{
inhouse = notArrived;
}
else
{
inhouse = checkedOut;
}
return inhouse;
}
private static bool ToBool(string value, bool defaultValue = false)
{
bool result;
return …Run Code Online (Sandbox Code Playgroud)