Questions tagged as '.net'

1
answer

Using features of the Timer class (System.Timers) is a Windows service?

I need to do a check in the database once a day . I'm thinking of using the class Timer (System.Timers) . Will the time contactor feature burden / slow down other system services? Is this solution advisable within a Windows servi...
asked by 27.08.2014 / 22:16
1
answer

How do I know if at least one element in a list is contained in another list?

I have two lists: var lista01 = new List<int> { 1, 2, 3, 4, 5 }; var lista02 = new List<int> { 7, 7, 7, 7, 7 }; I need to check if at least one element of list 1 exists in list 2, so the result for the above example should be fa...
asked by 24.12.2013 / 23:54
1
answer

Is there any specific type for non-String passwords in .Net?

I see very commonly the use of string s to store passwords in the program memory, not only in .Net, but in all programming languages I have ever used. At first, I do not see a problem in this. But as I know the .Net ecosystem is HUGE,...
asked by 26.02.2014 / 16:08
3
answers

How to know the week of a given month?

I'm working on ASP.NET MVC 4, and I want to know what the week is for a given month. For example, the user wants to define a frequency of occurrences, and as such says: The occurrence will occur every%% weeks%; The occurrence will happe...
asked by 04.02.2014 / 16:35
1
answer

Access modifier Internal X public

When to use public or internal? Is there any advantage / disadvantage between them?
asked by 17.11.2015 / 22:24
2
answers

Warning: "Possible multiple enumeration of IEnumerable"

I was doing some operations where I make use of collections. In one of these I needed to get a range (% w / o%) of numbers and did the following: var range = Enumerable.Range(0, 4); And then I tried to do something like var primeiro = ra...
asked by 25.11.2015 / 12:55
1
answer

Strange property initialization

When reading a tutorial on Entity Framework, I came across an example code where there was a line that, for me, is unknown: Student stud = new Student() { StudentName = "New Student" }; I understand that a new object of type Student...
asked by 02.05.2016 / 16:29
1
answer

Dependency injection in .Net Web API project 2

I'm involved in a project that is developing a .Net Web API 2 Fw 4.51 application (with a view to future migration to .Net Core , which is an 'aggravating'), Fluent NHibernate e PostgreSQL , and we're choosing a IoC con...
asked by 27.08.2016 / 12:55
1
answer

Setup.msi prompts the user to install the .NET Framework 4.6.1

I have a * .msi package of software developed by me with the Visual Studio Setup Project. When a user attempts to run the installation package on their machine and the installation package does not have version 4.6.1 of the .NET Framework, a...
asked by 08.07.2016 / 09:10
4
answers

Why use the using block in ASP.NET MVC?

Does the using {} block work in the same way in both web and desktop applications in the sense that when we use it in controller ? It is a good practice to declare it in actions that there is contact with database Follow exam...
asked by 21.10.2015 / 18:09