Posts by Minelli • 359 points
11 posts
-
4
votes1
answer384
viewsA: Asparallel(). Forall vs async await
As commented by João Martins, Asparallel is multi-threading - i.e., you are running tasks in parallel using multiple threads - and async/await is asynchronous - i.e., the task can be stopped by…
-
0
votes2
answers404
viewsA: Consuming Webapi by Angularjs
In theory, without having access to the other Web Api settings, it’s all right. You have access to the ones on the web server where the application was published to check if the request actually got…
-
1
votes2
answers258
viewsA: Global Exception Handling with Web API 2
You should register like this: public static class WebApiConfig { public static void Register(HttpConfiguration config) { config.Services.Add(typeof(IExceptionLogger), new ErroLogTeste()); ... } }…
-
1
votes1
answer946
viewsA: Reading headers in Webapi
If your controller inherits from ApiController, you can recover the headers of the requisition through the property Request, who in turn owns a property Headers. In the specific case of…
-
0
votes1
answer51
viewsA: How to create MVC 4 web.api project instead of MVC 5
I suggest installing Visual Studio 2012 Express for Web on a virtual machine (in Azure or AWS - a trial account should suffice), creating the ASP.NET MVC 4 project there, saving (in a Git or Svn…
-
7
votes2
answers175
views -
0
votes1
answer396
viewsA: Telegram bot without webhook
I didn’t quite understand what you meant by "consuming something already sent via API", but the fact is that all the interaction of Telegram Bots happens via HTTP. See more details on API.…
asp.net-web-apianswered Minelli 359 -
4
votes2
answers382
viewsA: What is the Microsoft Bot Framework?
It’s a framework (that is, it offers abstractions under which you program) for creating chatbots (software that works inside messaging apps; see more here). Microsoft provides C# and Javascript…
-
1
votes2
answers379
viewsA: Handle 404 error without using Try/catch
Why don’t you switch to the HttpClient? The return of requests is a Httpresponsemessage which makes no exceptions in case of failures, except if you use the method EnsureSuccessStatusCode // client…
-
1
votes2
answers66
viewsA: How to create a text file template?
Natively you just have String.Replace and RegEx.Replace, even. I suggest using a package ready as Stringtokenformatter or Namingformatter, or even a engine of templates, such as the Razorengine.…
-
0
votes2
answers94
viewsA: Simplify LINQ p => p.Tipo.Toupper(). Equals("S") && p.Modo.Toupper(). Equals("S")...,n
Whereas easier to read and understand code is also simpler code, you could change the type of the Type and String mode properties for enumerations. Thus the intention of the expression would be much…