Posts by Matheus Silva • 641 points
21 posts
-
1
votes1
answer119
viewsQ: Instantiating the database context in the controller
Hello, I have a question related to the Dbcontext instantiation mode in the controller. What is the difference between the two methods below instantiation ? 1. private ApplicationDbContext _db;…
-
2
votes1
answer431
viewsQ: Animate a side menu in WPF
Hello, I’m now entering the world WPF (I come from MVC), and I’m with a question: I’m trying to animate an expandable menu, IE, when the user clicks the button, it expands and when you click again…
-
0
votes1
answer773
viewsA: Pagseguro Notification API receiving 403 error
I was able to identify the reason for this return. When I am in the development environment (localhost:44333) the automatic sending of when changing the status in the sandbox somehow does not work.…
-
0
votes1
answer773
viewsQ: Pagseguro Notification API receiving 403 error
Hello, I am doing the integration of the Pagseguro API in a transparent way and in the test environment (Sandbox), when I make a change in the status of the transaction there in the Pagseguro panel,…
-
4
votes1
answer151
viewsQ: Unique contexts of authenticated users
Using the @Gypsy recommended method in this answer (It is possible to leave connectionString dynamically?), I was able to get a dynamic connection, and using the idea of mapping a context with the…
-
1
votes1
answer588
viewsQ: Is it possible to leave connectionString dynamically?
I’ve read something and I know it’s possible to leave one connectionString dynamically in an ASP.NET MVC application. However, it is possible to create n connections where each authenticated user in…
-
4
votes1
answer1975
viewsQ: Calling an asynchronous function in an Actionresult?
How to make the call of an asynchronous function on a non-asynchronous controller, to be clearer follows a situation: I have a form that when saving it needs to store data in the database and…
-
1
votes1
answer338
viewsQ: Abort an Ajax request
In a situation where I use the ASP.NET MVC, can cancel a request AJAX depending on the response of a modal? I am doing something like this: function atualizaStatus(sel, id) { var $status =…
-
4
votes2
answers1770
viewsQ: Referencing folders created in the project
After I go to Project > Add > New Folder, rename the folder and put classes inside it I can no longer reference it in another file, for example if I would use in one controller, I would use as…
-
0
votes1
answer24
viewsQ: Render different Partialviews randomly
I have the following scenario: I have to move on to a view data from different tables (similar data, but without any relation), until then I got good. I created a class (viewmodel) that receives the…
-
0
votes2
answers104
viewsA: Error saving a Many-To-Many relation
I managed to solve the problem as follows, I just changed the action: Controller [HttpPost, ValidateAntiForgeryToken] public ActionResult Novo(UsuariosNovo form) { var usr = new Usuario(); if…
-
2
votes2
answers104
viewsQ: Error saving a Many-To-Many relation
Following the models that of that question, I am having problems trying to save the data (keys of each of the records) in the table created to make the data relationship. Follows the post method I…
-
6
votes1
answer1271
viewsQ: Relationship Problem Many to Many in the Entity Framework
I have the following situation: To perform an authentication, I’m using the old method for a small application, for assigning levels (roles), as many examples are found all over the web. Use EF and…
-
1
votes1
answer882
viewsQ: How to resolve error: The best overloaded method match for
Following the models of that question, when I pass the commands to write the form data to the database, before even copying Visual Studio, points out the following error: "The best overloaded method…
-
2
votes1
answer346
viewsQ: Problems generating a Partialview with Begincollectionitem
With the intention of creating an action for Adc/Delete data dynamically to a table with relation 1 to Many, the . net returns the exception "Undefined object reference for an object instance." when…
-
1
votes1
answer255
viewsQ: How to write data in one table for many?
I have a question that still persists after making some searches. Is the following, assuming I have a form, where I register several emails to a single user, how I record these several emails in…
-
0
votes2
answers94
viewsQ: How to obtain data entered in a form not yet recorded?
Hello, In an application using the MVC, how do I get the data typed by the user in a form, and before recording in the database, I return a view with the data entered for the user to check and only…
-
3
votes1
answer117
viewsQ: Accessing data stored in cookies?
In login, I store user information logged in to a cookie (name, password, etc...) How do I access this cookie and redeem information from it? For example, I want the name of the logged in user to…
-
8
votes4
answers542
viewsQ: Why use block using in ASP.NET MVC?
The block using {} works in the same way in both web applications and desktops in the sense of when we use it in controller? It is a good practice to declare it in the actions that there is contact…
-
4
votes1
answer937
viewsQ: Entity Framework attribute list for entity mapping
For my sake Database be outside the EF convention, and as another system already developed uses it, it is out of the question to change table/column names. I would like to know the available…
-
7
votes1
answer104
viewsQ: Problem with . Include() in Entity Framework(Postgres)
I’ve been having a problem with Entityframework, it’s as follows: When I use the ORM(.Include) string to give a Join in tables with foreign keys, it automatically changes the name of the keys in the…