ADO.NET DataServices 客戶端類生成工具datasvcutil.exe

Generating Client Side Entities with datasvcutil.exe

Open the Blog Data Service from the previous post and browse to the service (http://localhost:1039/BlogDataService.svc), just to make sure we can access the service add pull its metadata. If you want to explore the data service metadata you can add /$metadata to the url (http://localhost:1039/BlogDataService.svc/$metadata)

Open a command windows and navigate to C:/WINDOWS/Microsoft.NET/Framework/v3.5 folder. In order to generate the client classes, we use the datasvcutil.exe tool with the following command:

datasvcutil.exe /uri:http://localhost:1039/BlogDataService.svc /out:BlogEntities.cs

This command queries the metadata of the Data Service from the input uri and generates the entities code in a file called BlogEntities.cs.

Microsoft (R) DataSvcUtil version 3.5.0.0

Copyright (C) 2008 Microsoft Corporation. All rights reserved.

Writing object layer file...

Generation Complete -- 0 errors, 0 warnings

 

 

源文檔 <http://blogs.microsoft.co.il/blogs/bursteg/archive/2008/05/12/visual-studio-2008-sp1-querying-ado-net-data-service-net-client.aspx>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章