Questions tagged as '.net'

1
answer

Are static members collected by GC when they are no longer needed?

In a class that has a static variable, it exists throughout the application. Is the linked object collected at some point? Example: public class Exemplo { private static List<int> lista = new List<int>(); }     
asked by 10.05.2017 / 16:16
1
answer

Why is the expression (double.MinValue == double.MinValue + 1) true?

The following C # code: public class Program { public static void Main(string[] args) { //Your code goes here Console.WriteLine(double.MinValue == double.MinValue + 1); Console.WriteLine(int.MinValue == int.MinV...
asked by 21.09.2017 / 00:25
1
answer

Sort list by similarity to a string

I have a list of string : AAA BBB CCC ABB ABC ACC ACD The user will type what he is looking for, he would like to take to the first positions, the most similar ones. Example: String: A Result: AAA ABB ABC ACC ACD BBB CC...
asked by 30.11.2017 / 18:37
2
answers

Convert string to DateTime in LINQ

I have a model where all fields are string . I want to convert to DateTime and Double For this I created a new model public class CPUStats { public DateTime Data { get; set; } public Double? Disco { get; s...
asked by 16.03.2016 / 14:41
1
answer

What are the actions of a controller?

In this answer Gypsy says    This (example) is good here when you have multiple Actions on the Controller What are the Actions of a Controller ? Note: I would like some code example too, defining a controller with two or more a...
asked by 21.10.2015 / 18:35
3
answers

Similar types but with different objects. What is the best way to use it?

I had to create a new object but totally equal to that existing in the C # system. Since the objects are the same I tried to do: ObjetoOriginal.Propriedades = ObjetoClone.Propriedades; Unfortunately it does not work, does it? I tried the...
asked by 13.01.2017 / 00:17
3
answers

How does initializing fields in constructors work?

In the C # documentation it is written:    If a class does not have a constructor, a default constructor is automatically generated and default values are used to initialize the object fields. That is, if a class does not have a construct...
asked by 01.02.2016 / 20:39
2
answers

Entity Framework WITH (NOLOCK)

We can use the NOLOCK feature in SELECT , thus avoiding locks with INSERT SELECT COUNT(Descricao) FROM Produtos WITH (NOLOCK) Would there be any way to use WITH(NOLOCK) in the Entity Framework?     
asked by 22.02.2017 / 17:08
2
answers

What is the maximum size of an object in 32 and 64 bits?

Specifically the array can have up to 4 billion elements, I think, and the most common element size sizes should be 4, 8, or 16 bytes. I ask, what is the maximum size that the object can occupy in memory? Would it be 4 GB in 32 bits? Is it u...
asked by 24.04.2017 / 16:45
1
answer

Letter after a number, what is this called?

What's the name of it? double d1 = 0d; decimal d2 = 0L; float d3 = 0f; And where can I find a character reference that I can use? If I want to do a cast from 0 to short , is there any letter for this?     
asked by 22.12.2013 / 01:46