Questions tagged as '.net'

6
answers

Converting a string to int?

What is the best way to convert a string variable to another variable of type int? , that is, nullable of int ? Performance is very important in this case because I will be converting multiple values into a loop. Wou...
asked by 24.02.2014 / 07:53
2
answers

What is the purpose of the operator = in the use of lists?

What is the purpose of the => operator in the use of List<T> lists, I'm starting to use generic lists and I came across this operator, it is only used in this method LISTA.ForEach(i => Console.WriteLine(i)); ? Below...
asked by 20.11.2015 / 01:23
1
answer

In the Entity Framework, do the SingleOrDefault () and FirstOrDefault () methods have different behaviors?

What are the differences between SingleOrDefault() and FirstOrDefault() , and when to use it?     
asked by 09.06.2014 / 00:18
1
answer

What is CultureInfo.InvariantCulture?

I have installed Resharper and in this section x.Id.ToString() it suggests changing to x.Id.ToString(CultureInfo.InvariantCulture) . What is CultureInfo.InvariantCulture and why is it better?     
asked by 06.10.2015 / 20:03
1
answer

Concat () VS Union ()

What is the difference between Concat() and Union() ? When to use Concat() and when to use Union() ? Can only be used in list ?     
asked by 19.03.2015 / 11:47
2
answers

Foreach or lambda in lists

What do I get the best performance to get the value of a data in a list? Do foreach or lambda (when possible, of course)? I can have this: foreach(var i in lista) { var teste = i.NmCampo; } Or this: var teste = lista.Select(campo...
asked by 11.03.2015 / 13:09
4
answers

How to do a search to know if a string is inside a vector in C #

I'm doing a small program that does search within a vector. The problem I am having is that if it finds the name it gives a message saying it was found but then it gives another message saying that it was not found, the code I am creating is thi...
asked by 30.05.2017 / 10:09
3
answers

Session limitation for saving data

I have a slow query in Oracle to list all accesses for a user, so I thought of writing the result to a Session , the average of records returned is 600, with%? Would you have any other better way to save this data?     
asked by 30.09.2015 / 21:29
1
answer

Difference between STAThread and MTAThread

What is the difference between STAThread and MTAThread and when should I use one or the other? Why and how do they say only about COM?     
asked by 08.07.2014 / 12:35
5
answers

Property readonly .NET

I received this question in a test and could not answer: "How can I declare a readonly property in .NET / C #?"     
asked by 31.01.2014 / 15:36