Questions tagged as 'c#'

2
answers

How do I round numbers to the nearest integer?

I have double numbers as double a = 0.4, b = 0.5; How do I round up?     
asked by 21.12.2013 / 17:59
1
answer

Creating many static classes does it impact system performance?

I've been creating many static classes to make code easier and cleaner, such as a Google Translate API call. public static class GoogleTranslate { public static string Translate(string word){ //código de chamada } } Doing so...
asked by 17.04.2018 / 15:14
1
answer

Is it possible to interact with C # code outside of .NET?

How do I call code written in another language that is not part of .NET, for example the C language? How does this interaction work? How do I call native Windows functions?     
asked by 09.08.2017 / 14:02
2
answers

What are the parameters out and ref

What are the ref and out parameter types of a method in C #? What's the difference between the two? Some examples of use of each.     
asked by 26.08.2015 / 14:08
3
answers

How likely is it to generate a Repeated Guid?

What is the probability of generating a Repeated Guid with Guid.NewGuid() ? I'm uploading numerous images from my system. The same will be a MultiTenancy, and will share the same Deploy, from the same folders. I assign the name of...
asked by 14.11.2014 / 18:46
6
answers

Which database should I use in a small desktop application?

I read a little of Meta and I thought that this question does not go far from the current rules of the site. Risking losing reputation, come on: I currently work in a small company that currently manages very sensitive data (documents, addres...
asked by 28.02.2014 / 13:10
3
answers

What is the function of #if false in C #? [duplicate]

I'm working on a project and I saw code blocks with this with #if false : What'sthedifferencetothis(commentedvs#iffalse)?     
asked by 08.03.2018 / 15:20
3
answers

What is the "question mark" in the C # type declaration? [duplicate]

I saw this code written in C # on the internet: namespace Test { [MicroEntitySetup(TableName = "Users")] public class User : MicroEntity<User> { [Key] public int id { get; set; } public string Name {...
asked by 28.04.2016 / 20:26
3
answers

What's the difference in the 3 types of variables and how do they behave in the compiler?

For test questions, I made the following code: static int valor1 = 10 / 5; static int valor2() => 10 / 5; static int valor3 => 10 / 5; public static void Main() { Console.Write($"{valor1}\n{valor2()}\n{valor3}"); } And the outp...
asked by 04.09.2017 / 12:51
3
answers

How to create a DateTime object that represents the last day of a given month?

In an object of type DateTime , how do I get a new object object DateTime that represents the last day of the month of the first object? var data = new Date(2017, 3, 1); // 01/03/2017 var dataUltimoDia = ??? // 31/03/2017     
asked by 09.12.2015 / 16:54