WHAT'S NEW?
Small Talk :: WCF :: RESTful service basics
I came across one question too many times on multiple websites and from multiple persons -
"What is REST and RESTful service?" or "Please tell me how to define RESTful service?" or "What is the significance of RESTful service?"
So, I have decided to write this post and believe this will clear the air about the basic understanding of RESTful service.
Here we go:
- REST stands for Representational State Transfer.
- RESTful service says that any service should be treated as a RESOURCE and it should be available and be accessible using simple HTTP binding.
- It says that any operations that we perform on database are resource operations. So, RESTful service should also be able operate in the same manner.
- Thus, all the CRUD operations, called the VERBS- that is actions should be performed using the REST.
- So they are – GET(), POST(), PUT(), DELETE().
What next? Think about ODATA services? .... sure, will take this up too for the benefit of all of us here, in the next post. Happy Coding!!!
Converting a normal ILINQ query to parallel linq query
A simple example for converting the normal linq query to a Parallel Linq query in dotnet.
public void NormalLinqQuery()
{
IEnumerable<int> localRange = Enumerable.Range(1, 100000000);
Stopwatch watch = Stopwatch.StartNew();
var output = localRange
.Where(getNum => getNum %
1234567 == 0)
.Select(rangeNum =>
rangeNum);
foreach (var num in output)
Console.WriteLine(num);
Console.WriteLine("Normal Query
in millisec: {0}",watch.ElapsedMilliseconds);
}
public void ParallelLinqQueryExample()
{
IEnumerable<int> localRange = Enumerable.Range(1, 100000000);
Stopwatch watch = Stopwatch.StartNew();
var output = localRange
.AsParallel()
.Where(getNum => getNum %
1234567 == 0)
.Select(rangeNum =>
rangeNum);
foreach (var num in output)
Console.WriteLine(num);
Console.WriteLine("Parallel
Query in millisec: {0}", watch.ElapsedMilliseconds);
}