Posts by Vinícius • 4,111 points
101 posts
-
0
votes1
answer114
viewsQ: Method finishes its execution unexpectedly when calling another method
I am implementing a method that performs a call to another method that should return one IEnumerable<TEntidade>. However, when returning from this list the method that started the call simply…
-
6
votes2
answers772
viewsQ: How to implement a chat in an Android app with backend Webapi
I’m developing an Android application that consumes services from a Webapi project. In one part of this application it will be necessary to develop chat between two or more people. Against this…
-
7
votes2
answers415
viewsQ: Fluent API with ASP.NET Identity
In accordance with this tutorial, I transported Identity in a class library to encapsulate the system’s business rule. However, the entire system is using Fluent API to map the entities and Identity…
-
7
votes3
answers190
viewsQ: Several tables that should represent a single entity
I am updating a system that has eleven tables that represent a single entity, I believe by implementation error, as an example below: Entidade: Foo Tabela Foo1 - Campo1, Campo2, Campo3 Tabela Foo2 -…
-
8
votes1
answer6769
viewsQ: Maximum number of simultaneous database connections
I am using a system monitoring solution and observe that at peak times the system has about 1500 simultaneous connections. From this data, I searched and could not find where I can check the limit…
-
0
votes1
answer325
viewsA: Settings not applied when initializing Tomcat
When Tomcat is configured as a windows service, it does not run the catalina.bat or startup.bat. Instead, to add new parameters to java_opts, you should follow the steps below. Open only Tomcat bin…
-
1
votes1
answer325
viewsQ: Settings not applied when initializing Tomcat
I have a specific setting to be performed on catalina.bat, and this setting works perfectly when starting the application server by running the script catalina.bat (or of startup.bat). However, when…
-
2
votes2
answers688
viewsA: Save data to a "Global Viewable"
In the post of your form (may be GET yes), you can treat the code in your controller as follows: public class ContaController : Controller { [HttpPost] public ActionResult SelecionarContrato(int…
asp.net-mvcanswered Vinícius 4,111 -
6
votes1
answer134
viewsQ: Authorization in class Ibraries
Doubt I’m with a project in which all business rule is encapsulated in a set of DLL’s with 3-layer architecture. I would like to know, what is the best approach to authorization control in these…
-
0
votes1
answer146
viewsQ: Browser screen size content
On many portfolio sites, we can see sections (usually with images) that take up the exact space of the user’s browser, such as this site here. I searched but did not find anywhere how to accomplish…
-
0
votes1
answer423
viewsQ: Transition with single page anchors Applications
How can I implement a smooth scroll transition effect through anchors using Jquery? The template below shows an example of a scroll transition I’m looking for. http://www.aimyapp.com/ I would like…
-
5
votes1
answer795
viewsQ: Good practice with . NET MVC
I have an ASP.NET MVC application and would like to know what good practices microsoft indicates in the organizational aspect of the solution, using the latest technologies such as ASP.NET Identity.…
-
4
votes1
answer121
viewsQ: Possible causes for a Session Leak
Through a monitoring tool, I am noting that my application has a considerable user session Leak. Every day, about a thousand user sessions are created, without any being destroyed. To take sessions…
-
3
votes1
answer121
viewsQ: "untrusted Domain" error when trying to connect to the database
While trying to connect to database, I get the following error: Login failed. The login is from an untrusted Domain and cannot be used with Windows Authentication. I’m using MVC 5 and below follows…
-
3
votes1
answer836
viewsQ: Mapping one-to-Many entity with Fluent API
I have two classes, as an example below: public class Foo { public virtual int Chave {get; set;} public virtual List<Bar> Bar {get; set;} } public class Bar { public virtual int Chave {get;…
-
1
votes1
answer112
viewsQ: Ajaxbeginform replace does not work
I’m using a Ajax.BeginForm to update a specific div on the page. When performing Submit and executing the action, instead of updating this DIV, the page is updated with the partial view returned…
-
1
votes1
answer562
viewsA: Doubt with View Tipada?
Itasouza, In this part of the code <p>model.PessoaId</p> To access your model, you would need to do it this way: <p>@Model.PessoaId</p> This is because by placing an element…
-
1
votes2
answers809
viewsA: Pass parameters via jquery to my model
From what I understand, you want to fill a property in your model through Jquery. If this is the case, you can place a hidden input in the view representing your model, and change the value of the…
-
2
votes2
answers64
viewsA: Why can’t I query for an added object before Savechanges?
Philip, As Tiago Cesar said, you cannot perform a query to the database relying on the entities inserted in the context until you execute the Savechanges command, as these are 'marked' as Added but…
-
5
votes1
answer5901
viewsA: Alert/pop up message in ASP.Net MVC
Pfvitor, good afternoon. From what I understand, you want a popup that displays information. You can directly use a javascript component called Alert in the view, as follows: <script>…
-
1
votes1
answer609
viewsQ: Update modal content dynamically
I have a table with up to 10 services listed, and each row has a refresh button. By clicking the refresh button, a modal window opens with the data of this line, as well as a form for change.…
-
10
votes3
answers1631
viewsQ: Concurrency control in database insertion
I have a competition control problem in entering data from a table. The scenario is as follows:: There is a table that records daily data according to user requests, and this data cannot be…
-
2
votes1
answer324
viewsQ: Entityexception when connecting to remote database
When connecting to the local bank, the application works 100%. However, when I try to connect to sql server remotely (on a redehost server), the application raises the following Exception: Below is…
-
3
votes1
answer237
viewsQ: Vallidationsummary shows no error on screen
I am using Validationsummary in Forms, but these are not being rendered. Is there any known reason for this error? Form example: @using (Html.BeginForm("CadastrarPessoaFisica", "Usuario",…
-
10
votes1
answer358
viewsQ: What are closures and what is their use?
The answer to this question on lambda What are lambda Expressions? And what’s the point of using them? talks about closures and Tree Xpressions, however, does not have a clear example of what they…
-
1
votes1
answer1355
viewsQ: System.Argumentexception when using Mysql with Entity framework
I installed Mysql Connect in the environment, installed Mysql references through Nuget package. When I start the system and try to make an entry in the database, the following error appears: The…
-
7
votes2
answers1416
viewsQ: What is the behavior of static variables in . NET?
What is the behavior of static variables in . NET? These are stored in heap or in the stack?
-
3
votes2
answers728
viewsQ: Simultaneous client side and server side requests
When using Ajax, I create an asynchronous request for my server. If I use N ajax requests simultaneously, I’m still handling these requests synchronously on the server? If yes, to create an…
-
1
votes2
answers122
viewsA: Invalidoperationexception when using the Databasecontext Set method
I was able to solve the problem through the tips that Lucas informed me. Using the Entity method of the modelbuilder passed as parameter in the Onmodelcreating method, I was able to register my…
-
0
votes2
answers122
viewsQ: Invalidoperationexception when using the Databasecontext Set method
When using the Dbcontext.Set() method, the following exception is raised: The Entity type is not part of the model for the Current context If I create a Dbset directly in Databasecontext, it works.…
-
0
votes1
answer351
viewsQ: Change language in the database during a query
Is it possible to change the language of the database only during the execution of an insertion query? I am having problems with date conversion due to the formation of them, the Bank expects…
-
3
votes5
answers1347
viewsA: Singleton or class and statics?
Gustavo Piucco, the Singleton design standard exists to ensure that a particular class will be instantiated only once. It is commonly used with a facade, to ensure that an application developed in N…
pattern-designanswered Vinícius 4,111 -
2
votes2
answers173
viewsQ: Is having two dbContext for the same Connection string considered bad practice?
I initially had a DbContext with all the DbSets of my entities. However, I needed to create a DbContext<T> who owns a DbSet generic for methods that are properly generic. It turns out that the…
-
4
votes1
answer275
viewsQ: How to add new properties to a user using Identity?
How can I create new properties using the Useridentity that comes by default when creating an MVC 5 application? Also, it is interesting to put information that does not belong directly to…
-
5
votes2
answers221
viewsQ: What is the reason for using Dbmigration in Codefirst?
What is the goal of using Dbmigration when developing a project using Codefirst? Using it is a good practice, or is something that does not cause major impacts on the implementation and/or…
-
10
votes2
answers5236
viewsQ: Relationship N for N and One for N with Codefirst Data Annotations
How can I Relationship N to N and One to N using Data Annotations? For example: A sales drive has a user, and a user can have multiple drives. This same sales movement has several products, and each…
-
7
votes1
answer404
viewsQ: Code First Mapping with Data Annotations
I am creating a project using mapping through DataAnnotations with Code First (similar to the Hibernate), without the use of FluentAPI. It turns out that in implementing this process, some…
-
1
votes1
answer164
viewsQ: Sql Timeout with Webmatrix.Data.Database
Using the Webmatrix.Data.Database namespace, I am having problems executing a query that returns a lot of data, resulting in a Timeout. How can I increase the timeout of this query? Code example:…
-
1
votes1
answer320
viewsQ: impact of a high heap memory on the JVM
What is the impact of having a high heap memory on the JVM? Does Garbage Ollector take longer to clear the memory when it is too high (around 12gb)? If yes, is there any way to prevent this delay…
-
4
votes1
answer112
viewsQ: Thread Safe and its link to Collections
What comes to be thread safe, and what is your connection to data collections?
-
4
votes1
answer187
viewsQ: Class protected and public
What is the behavior of a protected class? What is the impact of access modifiers (especially private and protected) on classes, and what are their common uses? I can understand its functionality…
-
3
votes3
answers9298
viewsQ: Return the previous page with the back button
I have a back button that is supposed to return to the previous page, regardless of which page is on the system. How can I do this using MVC 4? The returnURL has something to do with this feature?…
-
31
votes1
answer8090
viewsQ: Internationalization using ASP.Net MVC
How can I implement an internationalization system using Microsoft’s MVC technology? Is there something similar to Android so that my website can support several languages? Is there also some way to…
-
1
votes3
answers2113
viewsA: Application that does not need to load full page
From what I understand, you want to create a 'master page' structure for an MVC project with Razor. If this is really your question, you can create a page. cshtml that will be your Layout, and where…
-
1
votes2
answers741
viewsQ: Definition and utility of partial class
What is the use of a partial class, and in which situations is it recommended to use them? I have some classes in a project that are partial classes and I suspect that an alleged problem is related…
-
1
votes1
answer5007
viewsA: Pass parameters via post to Controller
One of the ways to send parameter via post to your controller is encapsulating your parameters within a form in the CSHTML of the kind POST and sending them through Submit. You can use the helpers…
asp.net-mvc-5answered Vinícius 4,111 -
5
votes3
answers523
viewsQ: Dynamic display of mandatory, optional or non-existent fields
There is a class that has 12 properties, which in its insertion in the database may be mandatory, optional or non-existent, depending on the business rule specified in the registration of another…
-
20
votes4
answers1166
viewsA: What are the differences between Generic Types in C# and Java?
Besides, I’ve never seen an example in C# that uses "wild cards" (wildcards) as Tipo<? extends TipoGenerico>. This is possible (or even necessary) in that language? Yes, it is possible to…
-
5
votes2
answers1050
viewsQ: Event that identifies when the browser is resized.
Is there any event javascript that identifies when the browser resizes the page? I’m having problems with resizing the page with a window FancyBox, which loses its dynamic changes and returns the…
-
2
votes1
answer655
viewsQ: Updating fancybox size dynamically
Hello, I need to resize the size of a Fancy box dynamically from an event onClick which will show other components on the page. I tried to use the following code snippet found here, and this resizes…