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...
I often see terms like LINQ query and lambda expressions .
Then the question came up, What I'm doing is a LINQ query, a lambda expression, or both?
Ex1:
var query = Produtos.Where(p => p.Descr.StartsWith("A")).Take(10);
Ex2:
var...
I asked this question here in SOPT
What is the equivalent of PHP's array_map in C #?
And I was curious to know what this System.Linq is about.
Because when I tried to use the above response code without using it, I got an error...
What is the difference between Any , Contains and Exists ?
What is the appropriate context for each of them? (Examples of use)
What are the advantages and disadvantages?
I have a list:
List<int> lista1 = new List<int>();
lista1.Add(1);
lista1.Add(2);
lista1.Add(3);
List<int> lista2 = new List<int>();
lista2.Add(1);
lista2.Add(2);
To get from lista1 elements that also exist in...
I'm working on a data integration between two bases, and I'm using Entity Framework for this.
I then generated the following code, which iterates each record in the Situations table of base dbExterno and feeds my base db :...
What is the advantage or difference in using the Set<> method, and can I do the same without it as in alternative 2?
Alternative 1
var aluno = contexto.Alunos.First(x => x.Id == entidade.Id);
contexto.Set<**Aluno**>()....
There are the following Objects:
public class Objeto1
{
public List<Objeto2> PropObj1 {get; set;}
}
public class Objeto2
{
public List<Objeto3> PropObj2 {get; set;}
}
public class Objeto3
{
public int PropObj3 {get; set;...
I have a list of events, and I would like to group them by year and month,
for example
[Year 2017] Month January
{Event 1, Event 2, Event 2} Month February
{Event 3} [Year 2018] Month January
{Event 4, Event 5}
I'm us...
To avoid string abuse and avoid code injection problems it may be a good practice to use Linq .
I can also imagine, for example, that it be slower.
Who has used Linq to communicate with database, would you recommend it?