1. What is Ado.net Data Services ?
Ado.Net Services formaly known as “Astoria“. It’s a facility that is used as a web services over net just like simple http with well known data format like jason or XML.
It’s a feature that allow user to mainuplate, traverse data through simple URIs. This allow easy access of data. The concept comes from general programming concept reffered as REST.It is avalilable with Vs 2008 + SP1.According to me I found only one and most important point that it is easily navigate through url.
Which is best feature.
2. What it requires to run it ?
Here I am going to explain an example just follow the same way for initital starting. Just follow below step.
Add new web project
Step 2:- Now add a new item “Ado.net Data Service” as shown in below fig when you add it. It adds a new item in your project just like I added “RajatDataService.svc”
By default you get shared method which is initializeService
Step3:- Add new item Ado.net Entity model as shown in below fig.
Once you add it then you will get screen like below fig it has edmx extention.
Before going further I just explain you in breif edmx “Ado.net entity model ” is just like Your linq mapper with extended functionality I will explain this later on in my new
Post. But for current point of time just think as ORM.
Step4 :- Once you done with this you have to do following code in your DataService.svc.vb file’s default shared method as we said in step 2
Public Class RajatAdoNetService
Inherits DataService(Of MedicalProEntities)
‘The medical proEntries is your model entry class
Public Shared Sub InitializeService(ByVal config As IDataServiceConfiguration)
‘ TODO: set rules to indicate which entity sets and service operations are visible, updatable, etc.
config.SetEntitySetAccessRule(“*” , EntitySetRights.AllRead)
‘ above line is use for access rules for entities in model
‘ The above line is service opration accessRules in this again just put * int first parameter, and all in second parameter
Then go to Internet explore option Tools –> Internet options –> Content tab ‘s Feed setting option and uncheck all the checkbox then
Refresh you will get fllowing screen
Simillarly you can access any entity in entity model or we can say any table from url.
I know this is not enough for your hunger even my too so don’t worry i will come up with more suitable example and live demo soon here I hope you people got basic understanding. I will come up with latest example and more description in next chapters
Till then enjoy the code.
Keep Shining & Keep Pushing , Keep programming