ADO.NET DataServices 客户端类生成工具datasvcutil.exe

本文介绍如何利用datasvcutil.exe工具从ADO.NET数据服务中生成客户端侧实体类。通过浏览并获取本地数据服务的元数据,使用命令行工具查询服务元数据,并将实体代码保存到指定文件。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值