Posts by Renan • 4,628 points
142 posts
-
2
votes1
answer275
viewsA: How to maintain a Session after re-running an application?
By default the storage mode of the Session is In-Proc, i.e., the information is stored in the server memory, however if the application is restarted your Session information is lost. An alternative…
-
1
votes1
answer304
viewsA: What better way to leave a value in session?
You can use the object Session to store patient information. The Session object allows the developer to obtain the data, previously persisted in the session, for a given time (configurable, but the…
asp.net-mvc-5answered Renan 4,628 -
1
votes1
answer857
viewsA: Error sending data to View
Using the select new, a new object of the anonymity type will be created as a result of the consultation. You cannot return an anonymous Ienumerable (IEnumerable<AnonymousType>) because the…
-
2
votes1
answer372
viewsA: How can I return to a Partialview, leaving the data loaded?
As when clicking on Details the user is redirected to another View, uma alternativa é você passar os valores informados no(s) filtro(s) da consulta quando o usuário clicar na opção de ver os…
asp.net-mvcanswered Renan 4,628 -
8
votes1
answer4622
viewsA: SQL increasing ID by 1000 units
From SQL Server version 2012 to Microsoft changed the way to generate these values, when your SQL Server instance is restarted, then the value of a field Identity pula 1000 if it is integer field…
-
2
votes3
answers2450
viewsA: Remove list item based on property value
That first way you tried: if (PlItens.Exists(x => x.nit_codit == 0)) { PlItens.Remove(x); } It doesn’t work because "x" doesn’t exist on the line you have PlItens.Remove(x);, it only belongs to…
-
3
votes3
answers1368
viewsA: What better way to save a Group object that has Items lists?
You need to receive Group and Group Items data when the user gives the Post. I don’t know if it’s the best, but an alternative (I’ve used several times) to this is you can create a Model (as…
-
1
votes2
answers2031
viewsA: Problems with types and conversions when filling a page
Unable to convert _list.Tolist() to a list of type Breakage.Models.Montaarvoreacao. An alternative: In his Model Breakage.Models.Montaarvoreacao you could create a method Creatlistaarvoreacao for…
-
6
votes2
answers10265
viewsA: Use of DTO and Viewmodel in ASP.Net MVC project
The web project "sees" only the repository project and it is responsible for executing the business rules... The ideal is to define the business rules in your project Domain and not in a repository.…
-
10
votes2
answers1623
viewsA: What is the real concept and usefulness of POCO classes?
Why the use of POCO classes? A POCO object has no dependency on a framework external. Exemplo: In my business layer, I create POCO objects so that this layer doesn’t have technology dependency and…
-
3
votes3
answers780
viewsA: Is it feasible to change databases in an existing system?
Therefore, I never did and I have no idea, in an Asp.net mvc project, how should I proceed with this? If you haven’t developed an Asp.net MVC project yet this one introduces the concept and has some…
-
1
votes3
answers206
viewsA: Context in services and repositories
Why and in which cases use each? I believe using Dbcontext directly, you end up being tied/tied to the technology, being a disadvantage if you need to change in the future. Another disadvantage to…
-
4
votes4
answers671
viewsA: Can I use Repository to do the BLL part?
Depends: If in your project you want your business layer (BLL) not to have references to data access technologies, data mapping, etc... of your project structure you can use this Pattern design. But…
-
1
votes3
answers613
viewsA: How popular Dropdownlistfor with information from a foreign key?
I don’t know if I understand this correctly, but I’ll answer as I understand it. You can create a class to be your own Model which will contain the Vehicle properties and a list for the user to…
-
15
votes3
answers1073
viewsA: Is controller returning HTML to View wrong?
I would use another solution. Reason: Mounting HTML is View’s responsibility. The Controller must process the requests and execute the logic (to retrieve information, change the database, etc...).…
-
2
votes1
answer913
viewsA: How to translate Strings from a . resx file?
You can create multiple resource files(Resource files). Resource files can be used to store strings which will be translated into other languages. Let’s say you have a resource file Resource.resx,…
-
4
votes2
answers4221
viewsA: What is the difference between SOAP 1.1 and SOAP 1.2?
The SOAP 1.2 version can do everything SOAP 1.1 does, and more. SOAP 1.2 cleaner, better web integration, more versatile and faster: Cleaner: clear processing and extensibility models, greater…
-
2
votes1
answer340
viewsA: Error in foreach
If I really get it, you simply want to render a Partial who’s kind PagedList.IPagedList<CEF01.Models.Ocorrencia> in View Index. So when do you render your Partial (in the case in your View…
-
2
votes2
answers352
viewsA: Understanding class instantiation
There’s another way that’s different and better. I recommend you use the standard Repository to retrieve the information necessary for your Controller. Why use it in that situation? With this…
-
1
votes1
answer4055
viewsA: Problem IIS 7 (high CPU consumption)
Could be a problem in some application, if an application makes incorrect use of memory or other system resources, in general the effects appear on IIS. To check if it is a problem in any…
-
4
votes2
answers691
viewsA: Change phone mask
Would look like this: $("#txtTelefone2").bind('input propertychange', function () { var texto = $(this).val(); texto = texto.replace(/[^\d]/g, ''); if (texto.length > 0) { texto = "(" + texto; if…
-
1
votes2
answers1007
viewsA: Data validation with mvc Asp.net (edition)
I’ve had that problem before, but I didn’t use the remote validation. In my case, it occurred when receiving the object the ID was equal to zero. Thus, the persistence framework I was using…
-
1
votes2
answers91
viewsA: Visual Studio 2013 only opens 2012 projects
The Visual Studio 2013 does not provide access to some templates which were available on Visual Studio 2012. If you want to use one of these templates, you can click on Visual Studio 2012. Behold at…
-
0
votes2
answers1013
viewsA: C# MVC EF5 delete relationships
One of the ways to solve it is: Get the group’s customer list as it is in your database (just so you know which one has been removed); Change/Update the customer list as you remove/edit the group’s…
-
3
votes5
answers1347
viewsA: Singleton or class and statics?
Using Singleton in reverse of a static class, its class depending on the scenario can: Inherit from another class Inherited; Implement an interface; Be serialized; Be passed to other classes; To be…
pattern-designanswered Renan 4,628 -
0
votes2
answers1637
viewsA: Query SQL with 2 subselects for query lambda (or Linq)
I believe this way you can achieve: var resultado = from tableA in TableA join tableB in TableB on tableA.FieldB equals tableB.FieldC join tableC in TableC on tableB.FieldD equals TableC.FieldE…
-
3
votes2
answers4935
viewsA: Sort List by decreasing values
Using Language Integrated Query () and Lambda. An example: List<Cromossomo> comossomosOrdenados = cromossomos.OrderByDescending(c => c.ValorFitness); Another example: List<Cromossomo>…
-
2
votes1
answer601
viewsA: Can we create the business rule in our model?
Yes, we can create business rules in the Model. Model represents the logical behavior of the data in the application. It represents the business logic of the application. I believe that the answer…
-
3
votes1
answer885
viewsA: Good Testing Practices
There are several types of testing you can do: Unit test: Testing at a component or class level. It is the test whose objective is a "piece of code". Example: Test your write methods and recover a…
-
0
votes2
answers234
viewsA: A way to unify calls in WCF Service?
It is possible to centralize all these services in a single service. You can have a WCF service with all methods. [ServiceContract] public interface IMeuServico { //Disponibilizar todos os métodos…
-
4
votes2
answers300
viewsA: What can I use to replace the Hidden input in ASP NET MVC?
You can use the object Session to store user information. The Session object allows the developer to obtain the data, previously persisted in the session, for a specified time in the Session…
-
14
votes5
answers6769
viewsA: Should I use GUID or int as the primary key?
Advantage of using GUID: It generates a unique value in each table and each database and this allows easy merge/merge/migrate records between different databases. You can generate your Ids in the…
-
4
votes1
answer7349
viewsA: How to access the application from another computer running on localhost
If you have the IIS (Internet Information Servces) installed on your machine, you can host your application as a website there. Other network computers can access it using http://<nome do seu…
-
3
votes2
answers340
viewsA: Is it bad practice to use foreach inside the View?
Is bad practice? No. The foreach can be used to display data in the View normally. Example: Assuming that my model (Product-type class viewmodel) has a list of products and I wish to display the…
-
5
votes8
answers16426
viewsA: Why is using "SELECT * FROM table" bad?
When you use a clause SELECT, you can specify the list of columns or expressions: select Coluna, Coluna, ..., Coluna from Tabela Or * (asterisk) as the selection list: select * from Tabela Avoid the…
-
12
votes4
answers42074
viewsA: What are the main differences between jQuery and Angularjs?
As regards differences in implementation of Angular vs. Jquery Angular.js is a framework. When running Angular.js, it is loaded, where its DOM and Javascript tree is transformed into an angular…
-
1
votes1
answer295
viewsA: Doubt on how to post a method to a web service, hide
One idea that can be interesting is you separate your services by customer. So each customer has reference to his service and the methods he wants to perform in specific, example: Client A accesses…
-
1
votes2
answers147
viewsA: Use lambda with Ado.Net
I have very little experience with sqldatareader but contextualizing... The ADO.NET is a set of classes that expose data access services to . NET Framework developers. The results of data…
-
5
votes1
answer1219
viewsA: What is service granularity?
"Service granularity" is used to measure abstraction depth which has been applied in the services. Granularity can be divided into two parts, being: Fine grained granularity (fine grained): It…
-
0
votes3
answers553
viewsA: What is the difference between a web service in the same project and a different project in the same project?
You could create this REST service using WCF or Webapi, both have their peculiarities. But an interesting question is also about the publication: Creating a new separate project from your Asp.Net…
-
2
votes2
answers921
viewsA: Recover Data Redirectaction mvc#
The Gypsy warned very well, really send your collection to the View using Tempdata is not the right way. As he suggested, it is interesting, but an important observation: "your View needs to be…
-
6
votes4
answers6431
viewsA: How does the interaction between the layers in C# work and what is the function of each one?
Your application should solve a business problem. Following this thought development should start at the Business layer. Given the above options, with the Business layer ready, you could go to your…