Solved

developing a restful server in .net

Posted on 2013-01-13
7
245 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ASCX file or a newer alternative? 1 34
Disable extension 8 37
Footer for each row on Gridview 2 21
Convert datetime to time string 10 20
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net 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…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

776 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