1
I am 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].[Schedule_Status]
where nu_mes = 12
The ds_category and ds_curve columns are created at the time the select is executed, as they do not exist in the table. It is possible to do the same thing in LINQ?
So far my LINQ query is like this:
var result = (from l in db.Schedule_Status
.Where(x => x.nu_mes == 12)
.Select(x => new Schedule_Status
{
nu_ano = x.nu_ano,
nu_mes = x.nu_mes,
id_projeto = x.id_projeto,
id_fase = x.id_fase
})
select l).ToList();
That would be yes, but doing so returns the following error message: 'Schedule_status' does not contain a Definition for 'ds_categoria'
– Leonardo Lima
I thought I did, and how you want to put information in a place that doesn’t have it?
– Maniero