Questions tagged as 'linq'

1
answer

Sql generated by Linq

Hello, I would like to know how to view the sql code that a linq expression generates to be run by ADO.Net. I'm using NHibernate as an ORM framework.     
asked by 03.03.2016 / 20:49
2
answers

Sort by join field with linq in MySql (C #, MVC)

I have the following query: query = from p in db.pessoa join f in db.pessoa_origem on p.Pessoa_Origem_Id equals f.Id join s in db.pessoa_status on p.Pessoa_Status_Id equals s.Id join c in db.contato on p.Id equals c.Pes...
asked by 24.07.2015 / 22:54
1
answer

How to: Populate object Collections from multiple sources

I would like an aid in passing values to my property with private IEnumerable<OrderDetail> orderDetail; . I would like to fill it out, but I have already looked for some examples and did not find anything with this situation. I as...
asked by 19.06.2015 / 18:35
1
answer

LINQ JOIN Doubt

Is there a right order to join? Example, I have two lists: categories and products, should I first use the from clause with the Categories or Products? And then Join? Example: var stockQuery = from category in categories...
asked by 19.05.2015 / 22:39
1
answer

IQueryable select data from multiple tables

I have a queryable linq to entities ) in the EntityFramework and I am not able to pull data from two or more tables. For example: var model = _service.List().Where(m => m.DS_GRUPO.Contains(searchString)).Select(m => new { m.PK_GRUPO,...
asked by 15.08.2014 / 21:49
1
answer

Problem - Linq SQL Server: Query unwanted in the database when assigning value in a derived field of the database

All right people I have the following problem: I have the method below that only has the job of updating a field in the database, the t_sap_log_jobs class that is passed as a parameter was created automatically when LINQ was configured....
asked by 31.07.2014 / 15:18
1
answer

Entity Framework Left Join

Seeing the question Left join with lambda GroupJoin and with condition , I came up with doubts around the way I do the Left Join with linq Having the following entities public class Cidade { public int CidadeId { get; s...
asked by 12.02.2015 / 13:45
1
answer

Show null results through LEFT JOIN with Linq!

I have a SQL query: SELECT A.Codplano, A.Secao, A.Setor,A.Subsetor,A.Contato, ISNULL(B.Subord,'NÃO LANÇADA')AS Situacao FROM vwPLANODIN A LEFT JOIN LANCADA B ON A.Codplano = B.Subord and B.Data = '2014-06-10' WHERE B.ID IS NULL and A.Sitio =...
asked by 14.06.2014 / 17:21
1
answer

Error reading XML

When I try to read xml, return it to me: {System.Linq.Enumerable.WhereSelectEnumerableIterator<System.Xml.Linq.XElement,SSP.Class.ListaConsulado>}XML:<?xmlversion="1.0" encoding="UTF-8"?> <paises> <pais> <n...
asked by 25.04.2014 / 21:29
1
answer

join for search field

I asked another user but I do not know what happened that I could not recover the information and had to create another one now. Anyway, I wanted to create a search field and gave me the controller and view answer below: public class HomeCon...
asked by 12.06.2014 / 17:34