Last post Sep 07, 2009 12:25 AM by chudq
Aug 28, 2009 04:18 PM|chudq|LINK
I just started to use WCF Rest project template to design a REST service, for example Collection REST WCF Collection service.
One thing I noticed that the Service.basic.svc.cs file is no longer under the Service.svc as its partial or dependent class file. I tried to find the definitions for CollectionServiceBase and ICollectionService in Service.svc.cs:
public class Service :
Sep 02, 2009 01:46 PM|tvish|LINK
The base classes that used to be in service.base.svc.cs have been moved into Microsoft.ServiceModel.Web.dll to reduce template code bloat. You can download the source for this from the codeplex site.
Sep 02, 2009 04:19 PM|chudq|LINK
I see. That's what I expected since the definitions are read-only meta codes. The question is that where is the place to customize descriptions, xml node names and others. I think there must be some other API or classes avaialble to provide ways to do customizations.
Do I have to get the souce codes to make changes. That will be too much work for each projects if I want different customizations.
Sep 02, 2009 05:01 PM|chudq|LINK
For example, ItemInfoList and ItemInfo in Perview 1 are in Service.basic.svc.cs file. Now they are moved to Microsoft.ServiceModel.Web.dll.
In the demo screencast, the attriubtes for ItemInfoList can be cusomized to "MyBookmarkList" and ItemInfo's attribute can be customized to "MyBookmark". Now those two classes are in dll, do I have to go into the source code to do the customization or if
there is any other API do to it?
Sep 06, 2009 10:47 PM|Yavor Georgiev - MSFT|LINK
We're looking at addressing this in the next release of the starter kit, which is due out soon. We recognize the need to make some customizations without having to import the code and build the entire base class yourself.
A little background on the issue: the first release of the starter kit had a lot of these base classes in the code-behind file, and we received feedback that customers were getting lost in the "heap of code" and wanted a more usable solution. So in Preview
2 of the stater kit, we pulled the base classes into a common assemlby, so customers wouldn't see it, but in doing that we decreased the user's ability to customize the service out of the box. Obviously it's tough to get the balance just right here and expose
only the things customers want to customize, and we're hoping to get there in the next relese of the starter kit.
Sep 07, 2009 12:25 AM|chudq|LINK
Two additional things I would like to see in the coming version:
First, the OnGetItem(string id) method should be able to handle special dot in the id. I posted a question this forum regarding this issue. Basically, if the id contains a dot (.), the base routing service would not call back to OnGetItem(id) method. I think
ASP.Net MVC has fixed this bug already.
The second enhancement is that I hope the core engine should expose basic APIs so that customized Uri requests can be extended. For example, I would like to add OnGetItem(starDate, endDate) method to get a collection by a date range. Within the method,
I know how to get the results. However, I would like IConllectionBase can be extended by my customized interface, as well as CollectionServiceBase with additional GetItems(...) for override.