Questions tagged as '.net'

4
answers

What is the most appropriate way to concatenate strings?

There are different methods for concatenating strings, such as Concatenating with the "abc" + str Formatting String.Format("abc{0}", str); Using StringBuilder new StringBuilder("abc").Append(str); Using the Concat...
asked by 11.12.2013 / 21:42
1
answer

What is Reflection, why is it useful? How to use?

Is it recommended to use in projects? In which situations Reflection can it be used?
asked by 15.04.2014 / 23:05
1
answer

What does the "$" symbol mean before a string?

Viewing a code here in SOpt, I noticed the use of the "$" symbol and I was not sure how to use it. What is the "$" symbol before a string ? What is it for? Why use it? Example using static System.Console; public class Program {...
asked by 07.10.2015 / 14:35
7
answers

How do I remove accents in a string?

I have a string áéíóú What I want to convert to aeiou How do I remove the accents? I need to save in the database as a URL.     
asked by 11.12.2013 / 16:51
5
answers

What is the difference between string vs string?

I'd like to know what the actual difference is between String (upper case s) and string (lowercase s). Apparently the two have the same goals, but which one is "better" to use?     
asked by 01.02.2014 / 11:31
1
answer

What is the meaning of the "??"

I was looking at some codes and I came across the ?? operator: static int? GetNullableInt() { return null; } int y = x ?? -1; What's the difference between the first code and the second one?     
asked by 16.12.2014 / 17:17
3
answers

Difference between the use of typeof and is

In C # when I need to check if a variable is of a certain type, I usually use the is : if(qualquerVariavel is int) Console.Write("A variável é int"); I know you can also check the type of a variable in other ways, one of them is u...
asked by 11.09.2015 / 21:14
1
answer

What is the difference between const and readonly?

Constants and read-only fields can not be modified, as can be seen in the documentation:    const   Fields and constant places are not variables and can not be modified .    readonly   When a field declaration includes a rea...
asked by 08.09.2016 / 17:17
2
answers

How does Stack work in C #?

I came to a part of my program where I have to apply a stack and wanted someone to give me a simple explanation and an example. The program that I am doing at the moment is a notepad where you create several "roles" to post something importan...
asked by 11.03.2014 / 23:06
3
answers

What is the difference between using virtual property or not in EF?

I have my models public class Cliente { public int Id {get;set;} public string Nome {get;set;} } and public class Pedido { public int Id {get;set;} public int ClienteId {get;set;} public virtual Cliente Cliente {get;set;} }...
asked by 04.03.2015 / 03:26