Posts by Thiago Silva • 1,954 points
31 posts
-
6
votes3
answers221
viewsA: List<> Best practice, start with fixed capacity or start without limit?
The advantage of using the list with a defined capability is that there will be no future relocation of the list items. When you use a list without setting the size, it starts with zero capacity and…
-
5
votes3
answers852
viewsA: Web Security api: SSL?
What you need to implement is authentication, mainly because you said that in the second moment you will have a mobile application. With the mobile app you will no longer have control of who is the…
-
0
votes3
answers1247
viewsA: Service does not execute controller method
Your route is set so that the first parameter is always called id. If you want to pass a parameter with another name you do so: http://localhost:9078/api/itens?idorcamento=1000012105…
-
1
votes2
answers366
viewsA: Return an object from two or more tables to the fields
You will need a second DTO which will be a property of the principal. After that just make a Join on LINQ to get popular data from the second table.
-
0
votes2
answers832
viewsA: Create route to webapi method with parameters via querystring
You are passing the wrong parameter when calling the action. In the error message you are page=1 and the action is waiting for the variable with the name pagina.
asp.net-web-apianswered Thiago Silva 1,954 -
4
votes1
answer236
viewsA: Lambda or Linq brings me all the fields and not only those of expression
Fields you did not specify in . Select are initialized with their default value. For example, all fields int will have the value 0, all fields string null and all fields DateTime will have the value…
-
1
votes1
answer35
viewsA: Session Usage vs SQL Query Function
Depends, where is this Séssion saved? In memory? How often do you do this check on a Request? If you do this more than once, you will get performance loss, since now you will have to go to the bank…
c#answered Thiago Silva 1,954 -
3
votes1
answer329
viewsA: Angularjs controller does not work well
You made a small mistake when declaring the controller you used ng-controller="PageController as pc" and at the time of using the property you set the value in $Scope, ie you ta settando in one…
-
2
votes1
answer48
viewsA: 0.. 1 to 1 modeling in the Entity Framework - Error The Entity or Complex
Your problem is time you make a select new CieloToken(). Try it this way: var temp = (from tok in db.CieloTokens join rec in db.CieloRecorrencias on tok.CieloRecorrenciaId equals…
-
1
votes1
answer416
viewsQ: Save Access Token
I’m designing a simple login architecture and I’m in doubt where to save the User Access Token. The system will be developed in SPA using Angularjs and the server will be a REST API not yet defined.…
-
0
votes1
answer115
viewsQ: Entity Framework and WCF navigational property
I am trying to implement a WCF service that will return a Model that I also use in the Entity Framework. When the model has a property virtual from navigation to association with another model WCF…
-
4
votes1
answer1289
viewsQ: Post typing effect on placeholder
Guys I’m trying to add a behavior to a placeholder but I’m not getting it. On the website of ticket with. when the user enters a value in the placeholder forml some and a small label appears above…
-
8
votes1
answer189
viewsQ: Different connectionstring for different builds
I have two Connection string, one when I am in development that uses my local bank and the other for when I deploy the application in Azure. I want the app to know which one to use depending on the…
-
1
votes2
answers312
viewsA: Where to call Savechanges() when you have multiple repositories?
You can change your method Save() to receive a transaction. This way you could check, if a transaction has been informed, only add the object in context and give the commit in the transaction after…
-
12
votes2
answers437
viewsQ: Performance difference of Any() and Count()
When I need to check whether a Collection has or has not elements which of the two methods will be faster, .Count() =! 0 or .Any()? I’ve heard that the .Count() may be faster in some cases. But by…
-
3
votes1
answer606
viewsA: Find a word in a JSON result
Change the code of if, instead of using == use the function strpos. if(strpos($collection['prod']['text'], "COLCHÃO")) !== false) strpos searches for the first index of a string, if not find returns…
-
4
votes2
answers4319
viewsA: javascript Alert - disable "Block confirmation windows of this page?"
This behavior is from the browser and not from Javascript itself. It works as if it were a browser security tool, to disable this (if possible) has to be done in the browser settings. In the case of…
javascriptanswered Thiago Silva 1,954 -
20
votes1
answer8086
viewsA: What’s the set for in Python?
Set is a Collection representing set. This collection has the characteristic of being disorderly and having the unique elements, that is, there is no repetition of elements in this type of…
pythonanswered Thiago Silva 1,954 -
1
votes2
answers684
viewsA: Filtering Kids Collection in Entity Framework with Lambda
from pai in ctx.Pai join filho in ctx.Filho on pai.Id equals filho.IdPai where pai.Ativo && filho.Ativo select pai If returning father is not enough, you can use one new in the select and…
-
0
votes2
answers944
viewsA: Right-click options menu selected in datagrid
You need to create a ContextMenu on your datagrid and put options on it. It goes something like this: <DataGrid Name="dataGrid"> <DataGrid.ContextMenu> <ContextMenu> <MenuItem…
-
4
votes1
answer107
viewsQ: Two different builds same source Visual Studio
I have a Solution with several projects. I need to create two "profiles" of builds different for two situations. This is possible? In build A I will show the menus X, Y and Z. In build B I will show…
-
3
votes1
answer3300
viewsA: Static variable in Python
Object Orientation in Python is a little different. If you create a variable it is accessible by default. The difference is as follows: If the variable is accessed by an object instance, it is…
-
0
votes2
answers1138
viewsA: Recover Edittext from Fragments in Activity
When you move from one Ragment to the other you will have to send the data that has been filled out to the other to not lose. For example, create a class with all form fields represented as…
androidanswered Thiago Silva 1,954 -
4
votes1
answer985
viewsQ: Dynamically add layouts
I created an XML with Linearlayout, in it I have a Spinner and an Edittext. On my screen I have a Linearlayout that should receive this other layout I created. My question is: how to add this custom…
-
5
votes1
answer1387
viewsQ: Display a message when Listview is empty
I have a Listadapter that extends a Basedapter that works perfectly. When it is empty I wanted a message to appear any. Where to implement this validation?
-
12
votes4
answers59952
viewsA: Copy files via SSH between two remote servers
You can do this quietly, just use the scp command. scp usuario1@host1:path/* usuario2@host2:path/* If the copy is only of files use the /* if you have folder use the -r in the scp. scp -r…
-
15
votes4
answers1418
viewsQ: How do I programmatically respond to a command on the Linux terminal?
I have a Python script that runs a certain command on the system. This command expects a password to be typed right away, the only way it works is this, it is not possible to pass the password via…
-
13
votes1
answer1462
viewsQ: Use Resultset without knowing the column type
I need to use a Resultset that returned the data of a query in the database. I’m making a very generic class, it can be used in any table, so I don’t know what kind of data it’s returning. For…
-
8
votes1
answer168
viewsQ: Project that Imports Other Netbeans Projects
I have a project where is the whole part of Hibernate configuration. In the final project I will have some more projects (Personal Registration for example) that will need the project that has…
-
15
votes3
answers1353
viewsQ: Architecture for a JSF Application with Android APP
I am in the planning part of a web application that I will develop for a Client. It will be Cruds and some report, nothing too complicated. At the moment I’m designing an architecture so that this…
-
8
votes7
answers8794
viewsA: How to Convert Mysql Database?
I suggest using Liquibase (http://www.liquibase.org/). He organizes the entire evolution of the database. For example. When I create a table I put the creation . sql in the base and run it. With…