Solved

developing a restful server in .net

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

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.
0
 

Author Comment

by:JDEE8297
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.
0
 
LVL 75

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?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:JDEE8297
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 vb.net).
0
 
LVL 75

Accepted Solution

by:
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.
0
 

Author Comment

by:JDEE8297
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?
0
 

Author Closing Comment

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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project

733 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