Questions tagged as '.net'

2
answers

Why are some string methods static?

I'm learning C # after already working with other languages, I noticed that some methods need to be called by the class string.Concat("123","456") I usually use it in other languages this way "123".Concat("456") Why can not you? Can...
asked by 13.03.2017 / 13:29
3
answers

How to replace hexadecimal value in a binary file?

Can you tell me how to replace the Hex value of a file with C #? Example: Replace 62 61 72 ( "bar" ) with 66 6F 6F ( "foo" ).     
asked by 28.02.2014 / 15:01
1
answer

CQRS - When to use and why to use?

What are the advantages of using the CQRS (Command / Query Responsibility Segregation) standard? What are the disadvantages?     
asked by 04.04.2018 / 22:47
0
answers

Content ID and Policies for use with Youtube API [closed]

I'm trying to upload my videos on Youtube, with Content Policy and Content Id Matching enabled. My project is in .NET with the Youtube API v3 library, but the library only allows the implementation below that is not working either. video.Monet...
asked by 05.09.2016 / 19:40
6
answers

How do I know which is the last element in a list?

I am doing a dynamic sql query, in which I use lists, my problem is, how to know which last element of this list Follow the code you have made so far: List<string> campos = new List<string>(); campos.Add("id"); campos.Add("desc...
asked by 25.06.2015 / 15:42
3
answers

How to invert an integer?

Notice this statement: /* * Faça um programa que peça um numero inteiro positivo e em seguida mostre * este numero invertido. Exemplo: * o 12376489 * => 98467321 * */ Console.Write("Informe um número inteiro para ser inv...
asked by 01.10.2017 / 20:55
5
answers

Return inside try ... catch does not work

I made this method: public int VerificaUltimaAnalise() { //Desenvolvimento WFExecutor vcmpExecutor = null; WFAnalise vcmpAnalise = null; Core vmpaCore = null; int vintCdTransa...
asked by 23.01.2015 / 14:03
1
answer

Recommended way to populate variables with bank data

Assuming this dummy method to get data from the database, let's say SQL Server: public List<DadosDTO> ObterDados() { try { comand = connectionFactory.CreateCommand(); comand.CommandText = "SE...
asked by 01.08.2014 / 15:39
2
answers

Reflection C #, how does it work?

I'm doing some testing with reflection , I made this code on the basis of trial and error, so I did not understand how exactly it works. This is the enum I'm using: public enum TipoDoAmbiente { [System.Xml.Serialization.XmlEnum...
asked by 23.09.2016 / 01:04
2
answers

Performative difference of Any () and Count ()

When I need to check whether a collection has elements which of the two methods will be faster, .Count() =! 0 or .Any() ? I've heard that .Count() may be faster in some cases. But by checking the source code , the metho...
asked by 11.08.2015 / 18:33