Solved

developing a restful server in .net

Posted on 2013-01-13
7
242 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 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.
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 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?
0
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

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 74

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

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 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…
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