2016-10-01 34 views
0

我已經創建了Asp.Net Web API 2 OData 3數據源。請求http://localhost:3000/odata/$metadata產生EDMX方案:無法在VS 2015中創建服務引用

<edmx:Edmx xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" Version="1.0"> 
<edmx:DataServices xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" m:DataServiceVersion="3.0" m:MaxDataServiceVersion="3.0"> 
<Schema xmlns="http://schemas.microsoft.com/ado/2009/11/edm" Namespace="mPOS.API.Controllers"> 
<EntityType Name="Book"> 
<Key> 
<PropertyRef Name="Id"/> 
</Key> 
<Property Name="Id" Type="Edm.String" Nullable="false"/> 
<Property Name="Title" Type="Edm.String"/> 
<Property Name="Count" Type="Edm.Int32"/> 
<Property Name="Price" Type="System.Nullable_1OfMoney"/> 
</EntityType> 
</Schema> 
<Schema xmlns="http://schemas.microsoft.com/ado/2009/11/edm" Namespace="System"> 
<ComplexType Name="Nullable_1OfMoney"/> 
</Schema> 
<Schema xmlns="http://schemas.microsoft.com/ado/2009/11/edm" Namespace="Default"> 
<EntityContainer Name="Container" m:IsDefaultEntityContainer="true"> 
<EntitySet Name="Books" EntityType="mPOS.API.Controllers.Book"/> 
</EntityContainer> 
</Schema> 
</edmx:DataServices> 
</edmx:Edmx> 

當我嘗試創建客戶項目服務參考,我得到了一個錯誤:

0141:命名空間「系統」是一個系統命名空間,不能用由其他模式。選擇另一個命名空間名稱

所以在生產EDMX方案有問題的部分是財產價格這就是類型System.Nullable_1OfMoney被指定爲系統命名空間中定義的架構複雜類型

我該如何創建此服務參考?我正在使用VS 2015社區版。

謝謝!

回答

0

我發現服務引用只能創建到版本3的OData服務。