Friday, December 17, 2010

Rx.NET

Rx- Is the new Library in .NET Framework to compose asynchronous and event based programs into Observable Collections. Rx also called Reactive Extensions. Rx Library comes in 3 flavors one for .NET 4.0, Silverlight and JavaScript. you can download and installed from the following link

http://msdn.microsoft.com/en-us/devlabs/ee794896

Pull Vs Push [ Interactive vs Reactive]

IEnumerable and IEnumerator   Pull-Based Collection

IObservable<T> and IObserver<T>. Push Based Collections

image

Duality

image

image

Next Blog Post we will see some sample programs using RX Framework.

Nandri(Thanks)

SreenivasaRagavan.

Tuesday, December 7, 2010

Using IXmlSerializable Interface to serialize Private Members or properties

Suppose let say we have a UDT(User Defined Type) object called person which has the following property's Name,Phone and SSN. Here SSN is read-only properties. When you serializing this person object you get the following error.because XmlSerializer wont serialize the Private members.

image 

To serialize the person object we can implement the  IXmlSerializable Interface as shown below..

image 

Now if you try serialize it will be serialized as XML with out error.

image

Here is the result

image

Nandri(Thanks)

Sreenivasaragavan

Sunday, December 5, 2010

Silverlight 5.0 mainly for LOB Apps and Rich media solutions

The Silverlight 5 beta will be available sometime in 2011 H1, and more information will be available at http://www.microsoft.com/silverlight/

Silverlight 5 introduces more than 40 new features, including support for running Silverlight applications with desktop features in the browser, dramatic video quality and performance improvements, and features that improve developer productivity.

Microsoft_Silverlight

Nandri(Thanks)

Sreenivasaragavan.

Saturday, December 4, 2010

Using ASP.NET Routing Instead of .svc file When Hosting WCF RESTful Service in IIS

 

ASP.NET Routing are generally used because they give you more control over your URI’s . Now let see how we can use this Routing to host WCF RESTful Service.

1) Create a WCF Service Application

2) Delete the .svc file

3) Now add  the following <serviceHostingEnvironment  aspNetCompatibilityEnabled="true" />to web.config file.

Next you need to  decorate the your class as shown below.

image

Now add Global.asax file to your Service Project and define the One Private method called RegisterRoutes.

image

Now call this method in Application_Start.

image

Now you can browse the service  as  http://localhost:5018/SreeniRestSvc

Nandri(Thanks)

Sreenivasaragavan.