Posts by Fernando Mondo • 601 points
17 posts
-
1
votes3
answers277
viewsA: How to concatenate sublists from a list and add values to them using Linq with C#
You can use the Selectmany Example: estoques.SelectMany(x => x.Itens) .GroupBy( i=> i.Id) .Select(g => new { Id = g.Key, Total = g.Sum(x => x.Qtd) });…
-
0
votes2
answers231
viewsA: Routing problems using Asp.net core
In Aspnet Core there is no more Annotation RoutePrefix, now both for Class and Action Annotation Route, like you did. But when you create the route [Route("api/getcliente/{cpf}")], You’re saying the…
-
2
votes1
answer579
viewsQ: How to store passwords in environment variables (and remove them from version control)?
I’m migrating from a local tfs to a private git (probably bitbucket). Today I simply encrypt webconfig, now I will have to take my sensitive data out of version control (Connection string,…
-
1
votes2
answers997
viewsA: How to customize Uitableview?
To disable the click of a specific cell: cell.selectionStyle = UITableViewCellSelectionStyle.None To change the source you can change by Mainstoryboard, or via code cell.textLabel.font =…
-
2
votes2
answers147
viewsA: Popular View with JSON
I agree with @Jefersonassis' reply that you should return a Json in array format. I also agree with @Otávio’s comment, you should use a Uitableview and a Customcell. But if you’d rather use that…
-
1
votes2
answers60
viewsA: I cannot print out the values of my Array.
This happens because the method $.ajax is asynchronous by default, ie it will run in parallel, and your console.log(Gostei); will be executed before he’s finished. Alternatively you tell the $.ajax…
-
2
votes2
answers824
viewsA: How to put the Datatable function for all tables at once
You can use the selector by element type: $('table').DataTable ({ scrolly: 300, paging: false });
answered Fernando Mondo 601 -
3
votes1
answer350
viewsA: Can you create a table with Swift that contains multiple columns?
You can user an Uicollection, which has exactly this grid behavior (excel type) https://developer.apple.com/library/ios/documentation/UIKit/Reference/UICollectionView_class/ But apparently, in your…
-
3
votes4
answers147
viewsA: Is there any way to decrease this script without losing functionality?
Apparently you have only 4 spans within the div.left, and when you put the class "colorBlue" in one you want to remove from all others. If this is the case, and span only have a single class,…
-
1
votes3
answers16008
viewsA: how to update column with single quote sqlserver
In Sql-Server you "escape" the simple quotes by duplicating it. Then the solution would be like this: UPDATE pessoas SET nome = replace(nome, '''', '"') WHERE nome LIKE '%''%';…
sql-serveranswered Fernando Mondo 601 -
4
votes1
answer344
viewsA: Ninject dependency injection for more than one web project
You can use Mudules as explained in the documentation: https://github.com/ninject/Ninject/wiki/Modules-and-the-Kernel Basically you create a Module in a DLL part, like this: public class…
-
0
votes1
answer114
viewsA: Do not add field if column equals Mysql
When you put cod != cod you’re comparing the code to itself. An alternative would be to group by code and take only the groups that have an occurrence: select sum(t.total) from (select sum(desconto)…
mysqlanswered Fernando Mondo 601 -
2
votes1
answer742
viewsA: Entity cannot be referenced by multiple instances
This error is happening because you are using two Dbcontext to manipulate the same entity. You could even use the Detach method in older versions of the Entity Framework and I believe the @Bruno…
-
3
votes2
answers52
viewsA: return Coredat - Swift
The syntax "as?" returns nil if it cannot cast, and in this case the value is of type Int, then the correct one would be like this: res.valueForKey("idade") as? Int But, you should take advantage of…
-
2
votes1
answer514
viewsA: Entity Methods in DDD architecture
There are several approaches and choices that vary with specific domains, but in the DDD the idea is to make the entity as "rich" as possible. This means that if you can put the method into a…
-
0
votes2
answers690
viewsA: How to pass variables as a parameter in a JSON object on Swift?
You can user the syntax "if Let" as you did more up, together with "as?" : if let nome = jsonResult.objectForKey("nome") as? String { print(nome) } Another way is to use "as?" and check later: var…
-
10
votes2
answers342
viewsQ: Redirect from Http to Https on Owin + Oauth + Google Externallogin
Host where my application is hosted uses ARR to redirect all pages to Https. The problem is that the way the code of the asp.net mvc understands that the requisition is http, even though https. When…