 |
| ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 4 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

July 17th, 2012, 09:49 AM
|
|
Authorized User
|
|
Join Date: Jul 2012
Posts: 21
Thanks: 1
Thanked 2 Times in 2 Posts
|
|
Ha! Thanks, Imar, for your input. You're absolutely right, I was mixing apples and oranges on that one. I was under the mistaken impression that it would return the value of the identity column with the idea that Codemaniac might want the value of the identity column to pass into the cache, not remembering this would be only to return the value of the identity column only during an insert. My bad, thanks for the catch.
As to the try/catch, I was merely trying to hint the model of "best practice" where applicable. I apologize, Codemaniac, for any confusion I may have caused you. 
|
|

July 17th, 2012, 10:02 AM
|
|
Authorized User
|
|
Join Date: Jul 2012
Posts: 21
Thanks: 1
Thanked 2 Times in 2 Posts
|
|
Codemaniac, please see Imar's answers as I think they encompass exactly the information you're looking for. And I would add that yes, REST can absolutely be implemented within a call from one web application to another. REST merely combines HTTP and a good URI scheme for addressing XML-based data, and since it uses the root protocol of the World Wide Web, it is hallmark of simplicity and totally appropriate for the situation you've described. Happy coding!
|
|

July 17th, 2012, 10:40 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Quote:
|
I was merely trying to hint the model of "best practice" where applicable
|
I see, and I agree. try/catch is a best practice for exceptions you're expecting (such as the SqlException in your case), but only if you're going to handle them.
So:
Code:
catch (SqlException)
{
throw;
}
wouldn't add much value over leaving out the try/catch block. But this:
Code:
catch (SqlException)
{
// TODO: log error
}
would ;-)
Cheers,
Imar
|
|

July 17th, 2012, 11:06 AM
|
|
Authorized User
|
|
Join Date: Jul 2012
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi Imar and guenfire,
I need an expert advice from you regarding the "REST call".
I have developed a dashboard which contains username and password. Now I want to transfer these credentials to another website so that user don't have to login again. AND I am asked to implement it through REST calls.
Could you please explain what is REST call. As far as I have researched REST is just a style just like object oriented programming is a style of coding. Could you please just break it down for me or point me to some tutorial.
Everywhere I see, REST call are implemented through a web service. Can't it implemented between a web application and a website.
Hoping for your expert reply. Thanks :)
|
|

July 17th, 2012, 11:18 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Heuh? Why are you posting the same message again? Didn't you see my replies? Did you read the articles I linked to?
Imar
|
|

July 17th, 2012, 11:28 AM
|
|
Authorized User
|
|
Join Date: Jul 2012
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Oh I am sorry, Didn't see the next page. Stupid me !!
Thanks for the links, Imar. I am looking into them links right now.
|
|

July 17th, 2012, 12:12 PM
|
|
Authorized User
|
|
Join Date: Jul 2012
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Dealer-->(Website 1 or 2)---->Dashboard<<--->> Website 3
Sorry for this crappy diagram, I would have inserted an image here, but I didn't know how to.
So,
-- - -- Dealer can login to any website (1 or 2) to see how many points he has got
- -- In order to redeem the points, dealer clicks on redeem button present on website 1 and 2
- -- When dealer clicks on "redeem" button, he/she will be redirected to a dashboard which will welcomes the user and tells how many points he/she has got
- -- Dashboard gets the total points from website 3 through REST calls and also to redeem points the dashboard redirects to website 3 which consists of items that user can purchase with those points (Website 3 is a reward site).
- -- the double arrows between dashboard and website 3 are REST calls.
- -- One more thing, the dealer only logins at website 1 or 2, from there the credentials keep on passing to dashboard and onto website 3
- -- dashboard doesn't need any login but website 3 does. dashboard is just an interface which welcomes the user and shows points (I know it has got no use, but it needs to be there.)
So, I just want expert advice from you on how to go about this project.
Thanks.
I was just asking chucks of this project before but now I am all confused and i think i irritated you guys also. :( pls help!
|
|
 |