public class City
{
public int Id { get; set; }
public string Name { get; set; }
public Geometry Location { get; set; }
}
我的实体框架实体City
类型有一个Geometry
属性。我得到如下数据:
public class CitiesController {
public Task<IActionResult> Get(){
var nearbyCities = context.Cities
.Where(c => c.Location.Distance(somePoint) < 100);
response OK(??? geojson string ???);
}
}
所以我想如何使用 Npgsql 或 Nettopologysuite 获取 Geojson 字符串?