Posts by Diego Jeronymo • 533 points
14 posts
-
1
votes1
answer38
viewsA: How to use Async/Await Asp . Net Core correctly
An important detail to note is that an asynchronous operation is different from a parallel operation. Using async/await this way allows asynchronous execution, which allows you to start an execution…
-
1
votes3
answers860
viewsA: Is it possible to call the same method in all Controller Asp.. net mvc without having to repeat the code?
There is a native Framework resource for this, called ASP.NET MVC Filter Types. Basically, you can define an Action filter to be executed at the beginning or end of each request to add your…
-
3
votes2
answers1906
viewsA: await Task.Whenall how to run multiple processes?
A point I always reinforce in questions about async/await: it does not make the execution of an asynchronous method by itself, it only allows the programmer to write methods in a running stream…
-
1
votes3
answers192
viewsA: Formatting with UNION and LINQ in C#
In this kind of case I believe that creating a specific type will solve, just do the desired formatting within the property set. A very basic example of how to do this: public class ResultadoPessoa…
-
4
votes1
answer1975
viewsA: Calling an asynchronous function in an Actionresult?
First of all, it should be clear that the use of async/await in Asp.Net applications has the purpose of only releasing the request threads during blocking operations (I/O, external requests,…
-
1
votes3
answers780
viewsA: How to send dynamically created fields via JSON?
In your case, I believe that using Action Filters is a good way, since you want to receive the content of your JSON already as a correctly filled instance in your Action. To make it happen the idea…
-
3
votes1
answer486
viewsA: When are threads (Thread Pool) initialized? - C#
When we talk about manipulating C#threads, we recommend using the Task Parallel Library (TPL), which is a higher-level API for manipulating the application’s Threadpool. Nor am I the one saying…
c#answered Diego Jeronymo 533 -
1
votes1
answer518
viewsA: Model arriving empty in controller
Your EP parameter is coming empty because your form in the View is not passing any value to your Action. Through the @Html.Displayfor() you are just displaying your values to the user, but you are…
-
1
votes2
answers433
viewsA: Bad request on a new iis server
The most practical way to get more information about IIS errors is to test it locally. This is because by default the detailed error setting is not displayed for external requests, even for security…
-
1
votes1
answer121
viewsA: How to improve Asp.net Membership security?
For any Cookie you need to create, regardless of language/platform, we strongly recommend setting the flag Httponly that helps you prevent manipulations of your Cookie through Javascript, and…
-
2
votes1
answer2403
viewsA: Thread - How to use it without freezing screen?
There are different ways to solve the problem of waiting for a while without crashing the GUI thread. 1) System.Timers.Timer, for . NET Framework 2.0+ Since you have a constant and predefined…
-
1
votes1
answer158
viewsA: Does Entity Framework need Session and Httpcontext?
The use of Session with the Entity Framework is, quite the contrary, discouraged. 1) Dbcontext implements the Unit of Work standard. This means that his goal is to help you include and load your…
-
5
votes2
answers411
viewsA: Fluent API and Migration
When we talk about mapping classes that use hierarchies for tables, regardless of ORM, we have 3 known patterns: Table by Hierarchy (TPH) The total denormalization of tables occurs, that is, the…
-
6
votes1
answer560
viewsA: Report progress to the interface of an asynchronous method in C#
The exception in question is because Windows Forms does not allow you to change your Form controls while running from a thread that is not the GUI thread. To solve this problem, you can opt for one…