1
I have a field int called OrdemDosProdutosDestaque  where I store products order preference (My customer choosing and storing in the database). 
ex:
1=Aleatório
2=Preço
3=Referência
4=Categoria
etc..
Model Configcliente
[Column("int_SORT")]
    public int OrdemDosProdutosDestaque { get; set; }
    public string OrdemDestaque() {
//tentativa de transformar int em algo utilizavel
        var retorno = "";
        if (OrdemDosProdutosDestaque == 1)
        {
            retorno = "Aleatório";
        }
        else if (OrdemDosProdutosDestaque == 2)
        {
            retorno = "Valor";
        }
        //etc
        return retorno;
    }
Then there in my controller i want to order the products according to customer’s option.
Something like:
IQueryable<produto> produtos = db.produtos
                        .Include(i => i.Cidade)
                        .Where(w => w.ClienteId == IDC && w.EstaAutorizado);
            if (ImovelEmDestaque)
            {
               produtos = produtos.OrderBy(o => o.cliente.ConfigCliente.OrdemDosProdutosDestaque);
            };
Of course in that case I’m still sending to the field int, but how to send properties as value, category, there model Product, or random, or otherwise model like photos?
OBS: In the Model Produto created a field bool TemFotos(), so I can easily know if you have photos or not.
Gypsy, I believe the
Guid.NewGuid()is translated toNEWID(), then the.OrderBy(p => Guid.NewGuid())will transform intoORDER BY NEWID(), then it should be possible to query "Random" without theToList().– Tobias Mesquita
You’re right. In SQL it worked.
– Leonel Sanches da Silva