developing a restful server in .net

Posted on 2013-01-13
Last Modified: 2013-01-21
What is the best approach to develop a restful service application, I read some stuff about web api, but was wondering if anyone has gone that approach on it or what else is out there.
Question by:JDEE8297
  • 4
  • 3
LVL 74

Expert Comment

by:käµfm³d 👽
ID: 38772909
If you are familiar with MVC, then WebAPI is nice to use. Even if you're not familiar with MVC, I think WebAPI makes rest pretty straight-forward.You can do REST in WCF, buf it takes a bit of setup.

Author Comment

ID: 38774217
So if I was building something from the ground up, and wanted it to be restful, web api may be the way to go. I am at the very start of this project, and I have being playing around with trying to set up restful services using various examples, and I keep coming back to web api when I am doing my research.
LVL 74

Expert Comment

by:käµfm³d 👽
ID: 38774647
Is there anything about WebAPI that you don't understand? Have you successfully set up a WebAPI project?
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails


Author Comment

ID: 38775111
Another question on this same topic, any time I have worked with the database, I have used datatables. Is that a no no and if it is a no no, what is a better approach. Was looking EF but that just seems like a lot of set up and wondering how efficient it is.

I really want to keep all of the database related things inside stored procedures, and not so much in backend application code (c# or
LVL 74

Accepted Solution

käµfm³d   👽 earned 110 total points
ID: 38775367
You could certainly use DataTables if you preferred. And there is no reason why you cannot use sprocs. That's the beauty of n-tiered architecture  : )

That being said, you may want to create an adapter pattern that maps your DataTable to an "entity" (read DTO) that you create. In this way, you can code your front-end to work with the entity, and the back end can use the DataTable(s). If you ever decide to switch to EF, you just need to swap out your DAL and remap the entity.

Author Comment

ID: 38775774
Thanks for your help so far on this, it has been greatly appreciated, I am starting to like this new web api more and more. Although, I will admit this MVC approach is a little confusing to me.

For example I have two public methods in my controller, where one of them takes a string as the parameter and another takes a numeric value. How does the webapi know which one to route my traffic to the appropriate method?

Author Closing Comment

ID: 38803926
thank you for your help, greatly appreciated.

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now