Questions tagged as 'linq-to-entities'

2
answers

apply filter on return from a list

I'm doing an query where I have a array of situations ex: 1, 2, 3 in the query I have to filter for these situations, follow my code. var array = GetSituacoes(); var lista = bll.Query(p => p.Contrato.PessoaFisica.ID == SessionControl.Pess...
asked by 17.05.2017 / 16:34
1
answer

How to format 'DateTime?' in dd / mm / yyyy format using Linq?

I have query below, but when I try to format the field Data_nascimento and Data_exclusao with .ToString("dd/MM/yyyy") it returns me a runtime error.    The 'System.String ToString (System.String)' method has no con...
asked by 11.11.2016 / 13:24
1
answer

Entity FrameWork Objects

I'm having a question with Entity Framework I have a situation in which I want to implement a structure in the database of a chart of accounts, for example: the current active account ID 1.1 is the parent of the account box 1.1.1, is my busin...
asked by 12.04.2016 / 21:25
1
answer

Query with Linq to Entities in many-to-many relationship

I have the following tables in a database: The TeacherCourses table joins the many-to-many relationship between the Courses and Teachers tables. I have been trying for a long time to make a query with Linq to Entities that returns all...
asked by 23.12.2016 / 01:50
1
answer

Linq to Objects - Performance

When looking for good practice content when doing LINQ I came across the following filter situation: // Filtros int idBairro = 8626; 1st way: IQueryable<TesteConsulta> queryCidade = (from c in db.ERPCEPCidade...
asked by 04.04.2018 / 20:32
1
answer

Error loading database information into a datagridview through the Entity Framework

My project has four classes: public class Manifestacao { public long Id { get; set; } public string NumeroChamado { get; set; } public string DataHoraReg { get; set; } public Cliente Cliente { get; set; }...
asked by 30.08.2017 / 20:16
1
answer

Left Join statement in LINQ to entites

I tried to do a left join in LINQ as follows: (from opr in db.Operacao join vol in db.Volume on new { VOL_CODBAR = opr.OPR_CODBAR } equals new { VOL_CODBAR = vol.VOL_CODBAR } into vol_join from vol in vol_join.DefaultIfEmpty() select new {...
asked by 22.12.2014 / 18:10
0
answers

Union with different dataTypes Linq-to-entities

I'm trying to return a grid! with headers and values below. I'm trying to do this! void Main() { var ctx = dbContext; (from tQuestions in ctx.Questions select new { a1_1 = (Object)tQuestions.HeaderCreationD...
asked by 24.05.2018 / 18:28
0
answers

select IN using entity query

How do I reproduce the following query using ef core, or in LINQ? SELECT ob.PK_OBJETIVO, ev.NM_EVENTO, ifi.QT_NOTA_IMPACTO, imi.QT_NOTA_IMPACTO, ire.QT_NOTA_IMPACTO, (ifi.QT_NOTA_IMPACTO + imi.QT_NOTA_IMPACTO + ire.QT_NOTA_IMPAC...
asked by 09.05.2018 / 20:24
0
answers

Dynamic LINQ from DTO - DateTime filtering

I'm trying to mount a dynamic filter from a DTOFilter object that I get populated through the View. My problem is, when I try to filter the results that will be shown on the screen by MesAno, I can not properly handle the data so that LinqToEnti...
asked by 10.08.2017 / 22:09