Questions tagged as 'linq'

1
answer

Query with Many-to-Many Relationship Entity Framework

I'm new to Entity Framework and Linq, so my question may be very simple, but it's breaking my head. I have two entities: public class Fornecedor { public int FornecedorId { get; set; } public string Nome { get; set; }...
asked by 23.12.2015 / 03:06
1
answer

What would Take and Skip in Linq?

I'm doing maintenance on a system and found a GetAllQueryable() , which uses the Take() and Skip() method. Well, I do not know what they are, nor what they are for, I researched but I did not find anything in the documentatio...
asked by 17.06.2015 / 15:59
1
answer

Group by with linq

I have the following tables: **Aula** Id Nome Data **Avaliacao** Aula_Id Aluno_Id Organizacao Didatica To get a join of the tables I use the code: var result = from a in mdc.SBE_AA_Aulas join av in mdc.SBE_AA_AvaliacaoAlunos...
asked by 04.06.2014 / 19:33
1
answer

Join with three or more tables with lambda

I made this expression using Lambda and 2 tables. var resultado = db.T_TarefaParceiro.Join( db.T_OsParceiro, t1 => t1.IDTarefaParceiro, t2 => t2.IDTarefaParceiro, (t1, t2) =...
asked by 30.05.2014 / 01:13
2
answers

Map Enum with search conditions

I have a class that does the search conditions as follows: public enum EnumCondicao { [Display(Name = "Igual")] Igual, [Display(Name = "Diferente")] Diferente, [Display(Name = "Maior")] Maior, [Display(Name = "Menor...
asked by 03.05.2017 / 03:11
1
answer

How to do "OR" between SubQuerys using LINQ C #

I would like to implement with LINQ C # (Using NHibernate as the following query : < return (from t1 in Session.Query<Tabela1>() join t2 in Session.Query<Tabela2>() on t1 equals t2.T1 where (from t...
asked by 12.05.2014 / 15:04
1
answer

C # Union / Order by with LINQ and Performance

Imagine the following situation there are 3 classes Class A, class B, class C, class A has many B classes and many C classes. class B has many C classes. the clsse C has a datetime date field. public class A { DBContext db = new ClassesConte...
asked by 07.05.2014 / 20:01
1
answer

Query only Date in a DateTime field with LINQ

I'm generating a report in an app I'm developing, but with a little problem. When I send a query in a date range, I can not get anything because it is a DATETIME (I can not change to date only, because I need the time in some moments). So I'm ju...
asked by 09.10.2015 / 17:00
1
answer

Transform Query into Linq

I need to transform this query into Linq: select B.Nome from Gestor A inner join Entidade B on A.UniaoEntidadeId = b.EntidadeId group by B.Nome HAVING COUNT(A.EscolaId) > 0     
asked by 13.08.2015 / 20:21
2
answers

Get null bank fields with LINQ

I have a Gestor table in the database where I store information for a user with Manager profile. In this table, I have two FK's : uniaoId and schoolId . Well, this manager MUST belong to a union and may or may not belong to a sch...
asked by 14.08.2015 / 14:27