Click here to Skip to main content
14,209,009 members

Web Development

 
AnswerRe: ASP.Net Web API Deployment Not Working Pin
Richard Deeming29-May-19 7:21
mveRichard Deeming29-May-19 7:21 
GeneralRe: ASP.Net Web API Deployment Not Working Pin
Kevin Marois29-May-19 7:42
professionalKevin Marois29-May-19 7:42 
GeneralRe: ASP.Net Web API Deployment Not Working Pin
Richard Deeming29-May-19 7:53
mveRichard Deeming29-May-19 7:53 
GeneralRe: ASP.Net Web API Deployment Not Working Pin
Kevin Marois29-May-19 8:12
professionalKevin Marois29-May-19 8:12 
QuestionPhoto Collage in Bootstrap...possible? Pin
Member 1208020129-May-19 6:05
memberMember 1208020129-May-19 6:05 
AnswerRe: Photo Collage in Bootstrap...possible? Pin
Pete O'Hanlon29-May-19 22:04
protectorPete O'Hanlon29-May-19 22:04 
QuestionHandling Web Request Failures Pin
Kevin Marois22-May-19 5:28
professionalKevin Marois22-May-19 5:28 
AnswerRe: Handling Web Request Failures Pin
Nathan Minier22-May-19 6:02
professionalNathan Minier22-May-19 6:02 
I think that largely depends on what your goals are. If you're trying to create an application that can be used offline and synchronize with the service(s), you might want to handle communication differently than an application that should only handle live data.

How would I divide it up logically? Well, I think that Separation of Concerns suggests that logic for handling failure status on a web request should be fundamentally segmented from success business logic, especially as you might want to have a global response (such as re-authenticate for a 403) to a failure rather than a by-method one. Now you have an advantage here: your ExecuteAsyc() returns a task instead of an object. This means that you can return a failure handling task, perhaps from some sort of failure state management factory that constructs tasks based on configuration.

This also means that you'll likely want to utilize a proxy wrapper for type T rather than a simple "new()", so that metadata about the request and error state can be passed with the data.

The best part about that approach is that you'll end up with a logical framework rather than a one off.

Just spit-balling, but that's the route that I would (and roughly do) go.
"Never attribute to malice that which can be explained by stupidity."
- Hanlon's Razor

QuestionRestSharp Response Question Pin
Kevin Marois20-May-19 13:30
professionalKevin Marois20-May-19 13:30 
AnswerRe: RestSharp Response Question Pin
Richard Deeming21-May-19 0:49
mveRichard Deeming21-May-19 0:49 
QuestionMessage Closed Pin
19-May-19 4:26
memberMaria_Bit19-May-19 4:26 
QuestionAuthentication/Authorisation Pin
Mycroft Holmes16-May-19 12:47
memberMycroft Holmes16-May-19 12:47 
AnswerRe: Authentication/Authorisation Pin
Richard Deeming17-May-19 1:03
mveRichard Deeming17-May-19 1:03 
GeneralRe: Authentication/Authorisation Pin
Mycroft Holmes17-May-19 12:44
memberMycroft Holmes17-May-19 12:44 
QuestionQuestion about empty button top positioning. Pin
neodeaths11-May-19 12:39
memberneodeaths11-May-19 12:39 
AnswerRe: Question about empty button top positioning. Pin
Richard Deeming13-May-19 8:09
mveRichard Deeming13-May-19 8:09 
QuestionWeb API Not Working Pin
Kevin Marois10-May-19 10:57
professionalKevin Marois10-May-19 10:57 
AnswerRe: Web API Not Working Pin
Richard Deeming10-May-19 11:12
mveRichard Deeming10-May-19 11:12 
GeneralMessage Closed Pin
16-May-19 23:01
memberavrora malkova16-May-19 23:01 
QuestionNeed Some Of Your Help Pin
Member 143595087-May-19 21:12
memberMember 143595087-May-19 21:12 
QuestionMessage Closed Pin
7-May-19 1:47
memberMember 143585397-May-19 1:47 
QuestionMessage Closed Pin
7-May-19 1:46
memberMember 143585397-May-19 1:46 
QuestionMessage Closed Pin
6-May-19 4:26
memberMrPharoah6-May-19 4:26 
QuestionMessage Closed Pin
6-May-19 4:16
memberLucid_App6-May-19 4:16 
NewsMessage Closed Pin
4-May-19 22:38
groupthree602019seo14-May-19 22:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Cookies | Terms of Service
Web03 | 2.8.190617.1 | Last Updated 17 Jun 2019
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid