Questions tagged as 'resharper'

2
answers

Differences between If and ternary operator?:

Is there a performance difference between using an if and a ternary operator in C #? I use Resharper (Productivity Tool for VS) , he insists that ternary operator is better but you do not explain why. Code, before Refactoring: if (i...
asked by 28.05.2014 / 16:01
3
answers

What's the difference between IEnumerable, IQueryable and List?

What is the difference between IEnumerable , IQueryable and List in .NET? When is it better to use one or the other? Why does ReSharper suggest changing the return of this function, for example, from List<T> : private Li...
asked by 27.05.2014 / 18:50
2
answers

Good practices in declaration of variables in a for

Lately I've been using Resharper and I've enjoyed the experience of using it, but something has intrigued me. At times it suggests that certain variables be declared within some scopes, as in the example below: var a = 0; for(var i = 0; i&...
asked by 08.12.2016 / 12:34
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

How to return to the default settings of the Visual Studio editor?

I was using ReSharper in evaluation period and after testing time I did not want to purchase and then uninstalled by Control Panel Visual Studio But the default settings of the Visual Studio editor did not return, such as the re...
asked by 15.08.2014 / 14:34
2
answers

What is the 'let' statement in a LINQ query?

I have the following LINQ query: var source = from em in query select new { Id = em.UniqueID, Data = em.Data == DateTime.MinValue ? "" : em.Data.Value.ToString("dd/MM/yy HH:mm")...
asked by 14.12.2015 / 17:15
1
answer

How to configure ReSharper to NOT add 'summary' comments

When using the ReSharper (StyleCop) 'Remove Unused Directives in File' or 'Remove Redundant Code in File' function to exclude some library from my project, ReSharper removes it, but adds comments throughout the project : // // </copyri...
asked by 22.10.2015 / 19:24
2
answers

Shortcut to create parameterized constructor

Is there any shortcut in Visual Studio, which creates a constructor, with all the attributes created in the class? class Alimento { public int ID { get; set; } public string Titulo { get; set; } public string SubTitulo { get; set;...
asked by 07.07.2015 / 15:47
1
answer

Remove namespace or full names

My question is if there is any shortcut, command or function of Visual Studio that removes the namespace or full names of classes, for example: to add a Data Annotation without making a using you have to put the complete namespace System. (), Bu...
asked by 22.05.2015 / 15:41
1
answer

What does "Inconsistent modifiers style" mean in Resharper?

Resharper is suggesting the following code change: Note: The classe Pagamento has public methods. Why the suggestion internal and not public ?
asked by 06.12.2015 / 15:48