C# 在c中的WebAPI2控制器中反序列化geoJSON#

C# 在c中的WebAPI2控制器中反序列化geoJSON#,c#,.net-4.5,asp.net-web-api2,geojson,C#,.net 4.5,Asp.net Web Api2,Geojson,我需要传递一些JSON,包括geoJSON对象,并将其反序列化到此模型: public class GeoTag { public Guid ID { get; set; } public DbGeography Geography { get; set; } public string Tag { get; set; } public Guid UserID { get; set; } } 我在.NET 4.5中

我需要传递一些JSON,包括geoJSON对象,并将其反序列化到此模型:

public class GeoTag
    {
        public Guid ID { get; set; }
        public DbGeography Geography { get; set; }
        public string Tag { get; set; }
        public Guid UserID { get; set; }
    }
我在.NET 4.5中使用Web API 2控制器,如下所示:

[ResponseType(typeof(GeoTag))]
        public async Task<IHttpActionResult> PostQuestion(GeoTag geoTag)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            //Do some stuff

            return CreatedAtRoute("DefaultApi", new { id = geoTag.ID }, geoTag);
        }
}

我无法让控制器方法解释
地理位置
;它将返回以下消息:

Unable to find a constructor to use for type System.Data.Spatial.DbGeography. A class should either have a default constructor, one constructor with arguments or a constructor marked with the JsonConstructor attribute. Path 'Geography.coordinates', line 4, position 19.

有人知道我所做的是可能的还是我的方法错了吗?

像这样更改Json

{
“标签”:“食物”,
“地理”:{
“坐标”:[“-0.1337”,“51.50998”],
“类型”:“点”
}
}


它将起作用……)

您提供的Json示例不是有效的Json。首先更改Json,它是无效的。请按照下面的答案更改Json。谢谢@KiShOrE。正如您在下面的回答中所描述的,我已经更改了JSON,但仍然无法正常工作。我已经更新了这个问题,并包含了从我的web方法返回的消息。
DbGeography
不是GeoJSON。谢谢@KiShOrE。我更改了JSON,但没有乐趣。我已经用您的JSON更新了这个问题,并包含了从我的web方法返回的消息。有什么想法吗?我已经添加了返回到上述问题的消息:开始“找不到用于System.Data.Spatial.DbGeography类型的构造函数”尝试此链接
Unable to find a constructor to use for type System.Data.Spatial.DbGeography. A class should either have a default constructor, one constructor with arguments or a constructor marked with the JsonConstructor attribute. Path 'Geography.coordinates', line 4, position 19.