A
A
Abc Edc2016-07-08 20:48:08
WPF
Abc Edc, 2016-07-08 20:48:08

How to process traces in c#?

How to properly handle traces with sending an HTTP request without accompanying the entire try catch code.
I am writing a client in xamarin, but any other example will suffice. I would like to understand how it can be processed globally, maybe some kind of Kernel can be written.
There are services with sending a zarpos

var someJson = await ......GetStringAsync();
 return JsonConvert.DeserializeObject<List<ExampleEntity>>(someJson);

And ViewModel
var res = await getAll()..
For example, a user logged in without the Internet, then a third-party http library returns a trace to me, how can I intercept it so as not to write every time in a service or model before a try catch request?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WarFollowsMe, 2016-07-09
@gleber1

1) Perhaps AOP
will help you Here is an article where an example of using PostSharp for try-catch is given
2) You can also try using AppDomain.UnhandledException .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question