以下のクラスを公開するために、breeze.js webapi を使用しています。DbGeography タイプがサポートされていないことを理解しているので、JsonIgnore を使用して出力から削除していますが、メタデータから無視/省略するにはどうすればよいですか?
Public Class Household
<Key>
Public Property Id As Integer
Public Property Postcode As String
Public Property Saving As Decimal
<JsonIgnore>
Public Property Coordinates As DbGeography
Public ReadOnly Property Latitude As Double
Get
Return Coordinates.Latitude.Value
End Get
End Property
Public ReadOnly Property Longitude As Double
Get
Return Coordinates.Longitude.Value
End Get
End Property
End Class
<BreezeController>
Public Class HouseholdsController
Inherits ApiController
Private ReadOnly _contextProviders As EFContextProvider(Of EnergyFriendContext) = New EFContextProvider(Of EnergyFriendContext)
' ~/api/Households/Metadata
<HttpGet>
Public Function Metadata() As String
Return _contextProviders.Metadata()
End Function
' ~/api/Households/Households
' ~/api/Households/Households?$filter=IsArchived eq false&$orderby=CreatedAt
<HttpGet>
Public Function Households() As IQueryable(Of Household)
Return _contextProviders.Context.Households
End Function
End Class
そよ風のjsエラー:
Unable to recognize DataType for: Edm.Geography