1
I have an SQL string (made by another programmer a long time ago, so I can’t change it) that returns something like this: If it has value in column, returns value, otherwise returns 0 (I would post here the SQL but it is gigantic).
However, column with value is decimal, without value is integer. To pass it to C#, I created a model with the property of type Dynamic:
public dynamic valorRetornado { get; set; }
But it comes null. I tried with Object and also did not function.
Does anyone have any idea?
@Harrypotter is here:
//Data é a string aonde está o SQL
var dados = db.Database.SqlQuery<Produtos>(data);
foreach (var itens in dados)
{
listaProdutos.Add(customer);
}
Junior you could post the C# code that redeems such SQL ?
– user6026
I’ll already put an example of how I would !!! Wait minutes
– user6026