Wednesday, November 10, 2010

WCF Data Services with Custom Data Source and Reflection Data Service Provider

I am going to show an example how to expose custom data source using wcf data services and OData. This is just a simple test.

Tuesday, November 2, 2010

HMAC MD5 in Flex and .Net

Regarding to my previous post, HMAC is a message authentication code (MAC) and can be used to verify the integrity and authentication of a message. I was trying to consume WCF Rest services from Flex.

Saturday, October 16, 2010

Sending multiple values in XML to database from application and parse using XQuery in SQL Server 2005

SQL Server 2005 has XML support, it means we can process XML on database side. There are some scenarios that we want to insert, update or delete multiple rows or send some different values to the database, one way is using delimited values and then on database side, we have to parse that string to retrieve the values, another way is using XML to send data to database, then in the stored procedure we can use XQuery and easily parse that XML.(the names are all case sensitive)

Friday, October 15, 2010

Digital Signature in REST Services to maintain the integrity of sensitive data in URI

When we think about REST web service, we all have heard this recommendation that we had better keep the application state on the client side, if the data regarding to the application state is not that large, then we can put that data in the URI, if you decide to do that to manage the state, then you need to have some kind of checking to make sure that state data has not been tampered. one option is using digital signature.

Thursday, September 23, 2010

How to parse large XML files efficiently using LINQ

Sometimes we want to parse a very large xml file and populate our custom objects and we need to do it efficiently, because the file is so large, we dont want to load the whole file in memory, using XmlReader looks good but needs a lot of coding and we have to take care of every details when parsing.

Tuesday, September 21, 2010

How to measure the time the method takes to run in C#

.Net framework provides StopWatch class in (System.Diagnostics.StopWatch). we can use this class to measure the time for a method takes to finish executing.

Friday, September 17, 2010

How to pass DateTime object from .Net to Flex using json

I have a wcf rest service in .net that needs to serialize an object to json that has a DateTime property and send it back to my flex application.

Friday, September 10, 2010

How to get the generated sql query sending to server by entity framework

This is a sample linq query in EF,
for example, we have 2 tables:
Contents, Tags (one to many, each content has zero or more tags)

Saturday, September 4, 2010

Consuming .Net WCF Rest in different ways

There are different ways to consume wcf rest services in .net, The basic idea is first creating the http request and include the message body and message header. we need to serialize the objects we are going to send, then we need to send the request and then get the response and deserialize to get the response objects.