Posts by Gabriel Coletta • 1,787 points
63 posts
-
1
votes1
answer45
viewsA: custom rangeValidation
Along those lines: int len = strValue.Length; You’re picking up the amount of characters that are part of that string and not its value, so your Return does something like: return 4 >= 0…
c#answered Gabriel Coletta 1,787 -
1
votes2
answers254
viewsA: CRUD with images , working with Httppostedfilebase and byte[]
As the friend commented, for security reasons you will not be able to do something like this. If you want to allow this person to download the already uploaded photo normally you make an objectURL…
-
1
votes2
answers137
viewsA: Property error cannot be set to System.Double
First, you’re giving a .ToList() between the method .Select(lib => new Liberacao) and the method .Where(lib => lib.IdOrcamento == idorcamento), this forces my Iqueryable to run and the .…
-
1
votes1
answer331
viewsA: Error calling REST service
It is not interesting to work with entities (or object in your case) from the database directly in your Controller because your data may come in a formatting that your serializer may not understand…
-
-1
votes1
answer80
viewsA: How to Save All User Lists?
There are Linq queries that manipulate information within collections. If you wanted to add just these three properties instead of an entire object, it would look something like: suaLista.Add(new…
-
0
votes2
answers739
viewsA: MVC Custom and Friendly Routes | Create a Route with only one parameter in the URL
Assuming you don’t have another Maproute, you made a controller called ProdutoController with an action called Detalhe?, if you have not done your web server will not find this route and will give…
-
2
votes1
answer59
viewsA: It is possible to know in which Routes. Map() the call of an Action fell? ASP.NET MVC5
Yes, you can access route data as your controller inherits Controller or ApiController public ActionResult Image(string id) { //Caso seja ApiController var route =…
-
0
votes3
answers1667
viewsA: Avoid duplicated list data
Instead of using logic, you could use classes that implements ISet<T>, the HashSet<T>, For example, it does not accept duplicates by default being a good option. However it does not work…
-
2
votes1
answer7457
viewsA: How to make a SELECT with Entity Framework?
Are these questions in the same entity as the answers? If it is you need to use an anonymous type: var Resultado = Jogo.Select(x => new {x.Pergunta, x.RespostaUm, x.RespostaDois, x.RespostaTres,…
-
0
votes2
answers433
viewsA: Deserialize array in Json
You need to use Newtonsoft to do this. Take a class to receive him; public class Coordenada { public float latitude {get; set;} public float longitude {get; set;} } Understanding that Json is a…
-
10
votes1
answer125
viewsA: How to make application lock/unlock on Windows startup?
Keep in mind that everything in C# is class-based, so at first glance you should imagine that there is a class for this. The Registrykey class (Microsoft.Win32) serves exactly to create a registry…
c#answered Gabriel Coletta 1,787 -
1
votes1
answer439
viewsA: List or Datatable desktop c#
Even with the edition still very ambiguous his idea of "better", I will quote some interesting points that can end up covering your doubt. Thinking about performance, a lot of people say that List…
c#answered Gabriel Coletta 1,787 -
1
votes2
answers194
viewsA: Windows Universal Apps C++ vs C#
Basically, you can use C++/C# to create IOS, Android and Windows application and use Shared project to share class library between platforms, is a Solution that builds several different binaries,…