Questions tagged as '.net'

2
answers

How to add item in array through a foreach?

I'm doing a check in a directory where all the items with a specific extension are ready. I need to add the items in an array via a foreach . Here's part of the code I've tried. DirectoryInfo di = new DirectoryInfo(_caminhoEmail...
asked by 11.10.2016 / 15:35
3
answers

Shuffle numbers from a list? [duplicate]

Well, initially I do not understand much of a list in C #, but I have a list of type int that will always have 4 elements that are: 1, 2, 3 e 4 , I'm assigning them with .Add , if someone knows another Give me a little help...
asked by 10.09.2015 / 06:20
1
answer

What aspects-oriented programming frameworks exist for .NET? [closed]

Researching about aspect-oriented programming , I found a framework that implements this paradigm, the PostSharp . But this tool is paid for some features. Does anyone know anything else?     
asked by 16.09.2014 / 05:21
1
answer

How do I calculate with 3 variables of type DateTime?

I have these 4 variables: public System.DateTime TempoOtimista { get; set; } public System.DateTime TempoProvavel { get; set; } public System.DateTime TempoPessimista { get; set; } public System.DateTime TempoRevisado { get; set; } TempoRevis...
asked by 14.10.2015 / 03:21
1
answer

DateTime "Null" = 01/01/0001

How to treat a DateTime field that comes as "null" (I know that DateTime can not be null ) of a legacy base? Querying a WebService returns a DateTime field as 01/01/0001 (no value), in the case...
asked by 16.10.2015 / 05:01
2
answers

Format string in View

Is there any way to format a string (returned from a query) directly into View , to display the first letter of the letter and the lower case? Ex: In C # I can use the TextInfo.ToTitleCase for this. string title = "war and peace"; Tex...
asked by 04.02.2015 / 19:21
1
answer

What is the difference between Task and async Task?

In the code below I wrote two methods, one with Task return and another async Task . What happens differently in the execution of these methods since for one I added in the construction the reserved word await and in the othe...
asked by 09.08.2018 / 16:53
2
answers

How to return the name of an instance of a class?

In order not to have to manually write the data after an update on the objects, I decided to create a method of type static to be accessed by passing the object as a parameter. public static void Relatorio(Trem trem) {...
asked by 30.09.2018 / 20:22
1
answer

How to implement an abstract method with a generic class in C #

I'm creating a functional Factory where I define what kind of output it is and what the required implementation methods are. With this implementation, when I try to use the object obj within the function that does every factory process...
asked by 29.08.2018 / 19:26
1
answer

Compiler error due to lack of constructor

I have the following classes: class Disciplina : public class Disciplina { public int Id { get; set; } public string Nome { get; set; } } interface IGenericaDAO : public interface IGenericaDAO<T> { bool Ad...
asked by 23.05.2017 / 15:17