{"action":"created","issue":{"url":"https://api.github.com/repos/OData/RESTier/issues/468","repository_url":"https://api.github.com/repos/OData/RESTier","labels_url":"https://api.github.com/repos/OData/RESTier/issues/468/labels{/name}","comments_url":"https://api.github.com/repos/OData/RESTier/issues/468/comments","events_url":"https://api.github.com/repos/OData/RESTier/issues/468/events","html_url":"https://github.com/OData/RESTier/issues/468","id":166715461,"number":468,"title":"Make RESTier's support  Geography data type","user":{"login":"chinadragon0515","id":12759740,"avatar_url":"https://avatars.githubusercontent.com/u/12759740?v=3","gravatar_id":"","url":"https://api.github.com/users/chinadragon0515","html_url":"https://github.com/chinadragon0515","followers_url":"https://api.github.com/users/chinadragon0515/followers","following_url":"https://api.github.com/users/chinadragon0515/following{/other_user}","gists_url":"https://api.github.com/users/chinadragon0515/gists{/gist_id}","starred_url":"https://api.github.com/users/chinadragon0515/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chinadragon0515/subscriptions","organizations_url":"https://api.github.com/users/chinadragon0515/orgs","repos_url":"https://api.github.com/users/chinadragon0515/repos","events_url":"https://api.github.com/users/chinadragon0515/events{/privacy}","received_events_url":"https://api.github.com/users/chinadragon0515/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/OData/RESTier/labels/in%20progress","name":"in progress","color":"0052cc"}],"state":"open","locked":false,"assignee":{"login":"chinadragon0515","id":12759740,"avatar_url":"https://avatars.githubusercontent.com/u/12759740?v=3","gravatar_id":"","url":"https://api.github.com/users/chinadragon0515","html_url":"https://github.com/chinadragon0515","followers_url":"https://api.github.com/users/chinadragon0515/followers","following_url":"https://api.github.com/users/chinadragon0515/following{/other_user}","gists_url":"https://api.github.com/users/chinadragon0515/gists{/gist_id}","starred_url":"https://api.github.com/users/chinadragon0515/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chinadragon0515/subscriptions","organizations_url":"https://api.github.com/users/chinadragon0515/orgs","repos_url":"https://api.github.com/users/chinadragon0515/repos","events_url":"https://api.github.com/users/chinadragon0515/events{/privacy}","received_events_url":"https://api.github.com/users/chinadragon0515/received_events","type":"User","site_admin":false},"assignees":[{"login":"chinadragon0515","id":12759740,"avatar_url":"https://avatars.githubusercontent.com/u/12759740?v=3","gravatar_id":"","url":"https://api.github.com/users/chinadragon0515","html_url":"https://github.com/chinadragon0515","followers_url":"https://api.github.com/users/chinadragon0515/followers","following_url":"https://api.github.com/users/chinadragon0515/following{/other_user}","gists_url":"https://api.github.com/users/chinadragon0515/gists{/gist_id}","starred_url":"https://api.github.com/users/chinadragon0515/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chinadragon0515/subscriptions","organizations_url":"https://api.github.com/users/chinadragon0515/orgs","repos_url":"https://api.github.com/users/chinadragon0515/repos","events_url":"https://api.github.com/users/chinadragon0515/events{/privacy}","received_events_url":"https://api.github.com/users/chinadragon0515/received_events","type":"User","site_admin":false}],"milestone":null,"comments":8,"created_at":"2016-07-21T01:00:27Z","updated_at":"2016-07-28T08:49:19Z","closed_at":null,"body":"\r\nWe are working on the support for Geography data type in CollabDB and would like to ask you some questions regarding RESTier's support for Geography.\r\n \r\nFirstly, we've been searching for some time, but still haven't found examples of Geography type in RESTier code base (unit test?). We'd appreciate it if you could point us to some examples\\documentation if they're available.\r\n \r\nSecondly, we tried implementing it and  in our implementation, we mapped data from EDM.GeographyPoint to DbGeography (.NET type) and geography (SQL type).  We did changes in ChangeSetPreparer to do the mapping between EDM.GeographyPoint to DbGeography. The POST request worked successfully; the data was stored in SQL database. However, when we issued a GET request, the data did not come through, and we received the following error:\r\n \r\n\"message\": \"An ODataPrimitiveValue was instantiated with a value of type 'System.Data.Entity.Spatial.DbGeography'. ODataPrimitiveValue can only wrap values which can be represented as primitive EDM types.\",\r\n\"type\": \"Microsoft.OData.Core.ODataException\",\r\n\"stacktrace\": \"   at Microsoft.OData.Core.ODataPrimitiveValue..ctor(Object value)\\r\\n  \r\nat System.Web.OData.Formatter.Serialization.ODataPrimitiveSerializer.CreatePrimitive(Object value, IEdmPrimitiveTypeReference primitiveType, ODataSerializerContext writeContext)\\r\\n   \r\nat System.Web.OData.Formatter.Serialization.ODataPrimitiveSerializer.CreateODataValue(Object graph, IEdmTypeReference expectedType, ODataSerializerContext writeContext)\\r\\n   \r\nat System.Web.OData.Formatter.Serialization.ODataEdmTypeSerializer.CreateProperty(Object graph, IEdmTypeReference expectedType, String elementName, ODataSerializerContext writeContext)\\r\\n   \r\nat System.Web.OData.Formatter.Serialization.ODataEntityTypeSerializer.CreateStructuralProperty(IEdmStructuralProperty structuralProperty, EntityInstanceContext entityInstanceContext)\\r\\n   \r\nat System.Web.OData.Formatter.Serialization.ODataEntityTypeSerializer.CreateStructuralPropertyBag(IEnumerable`1 structuralProperties, EntityInstanceContext entityInstanceContext)\\r\\n   \r\nat System.Web.OData.Formatter.Serialization.ODataEntityTypeSerializer.CreateEntry(SelectExpandNode selectExpandNode, EntityInstanceContext entityInstanceContext)\\r\\n   \r\nat System.Web.OData.Formatter.Serialization.ODataEntityTypeSerializer.WriteEntry(Object graph, ODataWriter writer, ODataSerializerContext writeContext, IEdmTypeReference expectedType)\\r\\n   \r\nat System.Web.OData.Formatter.Serialization.ODataFeedSerializer.WriteFeed(IEnumerable enumerable, IEdmTypeReference feedType, ODataWriter writer, ODataSerializerContext writeContext)\\r\\n   \r\nat System.Web.OData.Formatter.ODataMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, HttpContent content, HttpContentHeaders contentHeaders)\\r\\n   \r\nat System.Web.OData.Formatter.ODataMediaTypeFormatter.WriteToStreamAsync(Type type, Object value, Stream writeStream, HttpContent content, TransportContext transportContext, CancellationToken cancellationToken)\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n   \r\nat System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\\r\\n   \r\nat System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n   \r\nat System.Web.Http.WebHost.HttpControllerHandler.<WriteBufferedResponseContentAsync>d__1b.MoveNext()\"\r\n \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/OData/RESTier/issues/comments/235836810","html_url":"https://github.com/OData/RESTier/issues/468#issuecomment-235836810","issue_url":"https://api.github.com/repos/OData/RESTier/issues/468","id":235836810,"user":{"login":"chinadragon0515","id":12759740,"avatar_url":"https://avatars.githubusercontent.com/u/12759740?v=3","gravatar_id":"","url":"https://api.github.com/users/chinadragon0515","html_url":"https://github.com/chinadragon0515","followers_url":"https://api.github.com/users/chinadragon0515/followers","following_url":"https://api.github.com/users/chinadragon0515/following{/other_user}","gists_url":"https://api.github.com/users/chinadragon0515/gists{/gist_id}","starred_url":"https://api.github.com/users/chinadragon0515/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chinadragon0515/subscriptions","organizations_url":"https://api.github.com/users/chinadragon0515/orgs","repos_url":"https://api.github.com/users/chinadragon0515/repos","events_url":"https://api.github.com/users/chinadragon0515/events{/privacy}","received_events_url":"https://api.github.com/users/chinadragon0515/received_events","type":"User","site_admin":false},"created_at":"2016-07-28T08:49:19Z","updated_at":"2016-07-28T08:49:19Z","body":"The other way to support geography is ,\r\n1. CLR class only have one property, and its Type is DbGeography\r\n2. Model builder will make DbGeography property been shown as correct Edm type. Refer to issue for this support.\r\n3. Write a customized serializer to convert DbGeography to correct type like GeographyPoint type.\r\n4. Correct a customized IChangeSetInitializer, it will need to convert value in change set from GeographyPoint type to DbGeography type before calling base initializer.\r\n\r\nAs this has model builder dependency which blocks to create an end to end example now, move this one to backlog."}}
{"actor":{"display_login":"chinadragon0515"}}