-2
In BD you have a field with a float value, which is actually the number of days from the date 28/12/1800, that the Clarion programming language stores. Well, I have a service REST that is consumed by an Android App. What happens is that I would like to serialize this field, but already as date. If I do outside the lambda works(test), only I need to transform inside the expression and do not know how I do it: The command is?
var dt = new DateTime(1800, 12, 28).AddDays(79018).ToString("dd/MM/yyyy");
With this command dt = 02/05/2017
. But I need to load a property from my DTO and error that the LINQ does not support ToString("dd/MM/yyyy");
My lambda is this:
lista = contexto.Liberacoes
//.Where(lib => lib.IdOrcamento == idorcamento)
//.Join(contexto.ItensLibs, lib => lib.IdOrcamento, itens => itens.IdOrcamento, (lib,itens) => new { lib, itens})
.Where(a => a.FlagLiberacao == 1)
.Select(libera => new LiberacaoDTO
{
TipoVenda = libera.TipoVenda,
IdOrcamento = libera.IdOrcamento,
Juros = libera.Juros.ToString(),
Entrada = libera.Entrada.ToString(),
Acrescimo = libera.Acrescimo.ToString(),
Desconto = libera.Desconto.ToString(),
Mensagem = libera.Mensagem,
DataLib = new DateTime(1800,12,28).AddDays(libera.DataLib).ToString("dd/MM/yyyy"),//ERRO AQUI
Vencimento = libera.Vencimento.ToString(),
Vendedor = libera.Vendedor,
Cliente = libera.Cliente,
Filial = libera.Filial
}).ToList();
I do not know why the negativity, because the question is not broad. As I disagreed with two guys the other day, I feel that they always negatively negatively affect me, regardless of whether or not the question is within the criteria of the site. Mind girl those. People take comments to personal side always, disregarding the rules of the site.
– pnet