Questions tagged as 'linq'

1
answer

Join with lambda expression only

With LINQ without problems. Now, how do I join with two or more tables? Below the join attempt I could not go through to the end. Two tables ( T_Acao and T_ProximaAcao ). Field in join is IDAcao var res...
asked by 27.05.2014 / 16:34
1
answer

No insert in the table is inserting everything, even what I do not want

When I give savechanges() , it writes to all tables and I would like only one. How I do? The Acao and ProximaAcao tables also inserts log. public T_TarefaParceiro geraIdParceiro() { WEBEntities db = new WEBEntities();...
asked by 02.06.2014 / 22:28
1
answer

How to make a LINQ query that returns the amount of people who were born per month?

I would like to make a LINQ query that returns the amount of people who were born in the month. In MySQL I make this query: SELECT COUNT(*) AS DataNacimento FROM pessoas WHERE MONTH (DataNascimento) = '12'; In LINQ I tried this query, bu...
asked by 24.11.2018 / 20:44
3
answers

How to do Update in Linq?

My project has the Delete method, but it definitely deletes the record from the table in the database. I would like to instead of delete, change the column record, I have a field called "Status", this field is an Enum with two options "Enable...
asked by 09.11.2018 / 16:34
1
answer

Returned list sorted in BLL?

In my project I use EF6 , I use generic repositories and in my BLL layer I have the ClienteBLL class, which is a class that has the logical implementation methods of the class. In one of the methods I return a list that re...
asked by 24.08.2018 / 22:28
1
answer

Converting a LINQ query to methods

The following query in LINQ (with query) below is used to list all providers that have an account (relationship 1 to 1): from f in fornecedores join c in contas on f.ID equals c.FornecedorID select f How can I achieve the same result using...
asked by 06.09.2018 / 20:10
1
answer

Error CS0266 Can not convert implicitly

When trying to make a listing where I only filter the 5 largest records by values in descending order this error is occurring:    Error CS0266 Can not implicitly convert type   "System.Linq.IQueryable" in   "System.Collections.Generic.ICollec...
asked by 25.05.2018 / 15:03
1
answer

Is it possible to create a column in LINQ?

I'm trying to turn the following query into LINQ SELECT [nu_ano] ,[nu_mes] ,[id_projeto] ,[id_fase] ,'Financial Progress ("Competência")' as ds_categoria ,'Baseline' as ds_curva FROM [Alvarez_Marsal].[dbo]....
asked by 19.04.2018 / 19:14
2
answers

How do I get a list of values common to two lists with LINQ?

I have two List, the first one, which is a list that contains all the establishments available in the company, for example: Estabelecimento Sigla - XPTO Descricao - XPTO List Estabelecimento Sigla - RPTO Descricao - RPTO List...
asked by 16.10.2017 / 22:36
1
answer

Bringing other columns with GroupBy with LINQ

I have two Tables: 1st Process containing ProcessId and SituationProcessId 2nd SituationProcess containing StatusProcessId Description Templates: public class ProcessoModel { public int? ProcessoId { get; set; } public int? Si...
asked by 06.09.2017 / 16:08