How to consume ASP.NET Web API RC with HttpClient?

In previous post I discussed How to consume ASP.NET Web API RC with RestSharp?. RestSharp seems to be a good candidate for working with REST service but during development I found out a problem that RestSharp doesn’t handle enum type very well and I got always null object by posting object to web service. The reason is because ASP.NET Web API serializes enumerated type to integer and RestSharp can only deserialize enumerated type under string format. As consequence you could notice in previous post, the Category property of Product is a kind of enumerate ProductCategories but I have to define it as int so that the serialization works.

Continue reading How to consume ASP.NET Web API RC with HttpClient?

C# – Use LINQ To XML to read XML report generated/created by Crystal Report

The requirement to read a XML file to Crystal Report is very common but how can we read a generated XML file by Crystal Report back to object class and why do we have to do that? Let’s consider this case, a company has SAP products and uses Crystal Report to create reports from databases of those products. Now he would like to export data from this SAP system to 3rd party product but this product has no idea about the database structure of SAP. He orders us to write a small program to do that. The question is what should we do now to keep process simple as it should be?

Continue reading C# – Use LINQ To XML to read XML report generated/created by Crystal Report