Hi,
this is my POCO
public class LRDRisultato : IHasId<int>
{
[Alias("IDDRISULTATO")]
[AutoIncrement]
public int Id { get; set; }
[Alias("CODICE")]
[StringLength(50)]
public string Codice { get; set; }
[Alias("NUMERODECIMALI")]
[Default(-1)]
public int NumeroDecimali { get; set; }
[Alias("VISUALIZZAONLINE")]
[Default(1)]
public int VisualizzaOnLine { get; set; }
}
I create a service to allow CRUD operations, then I
send the following json to create a new item
{
“codice”: “CONC”,
“numeroDecimali”: 4,
“visualizzaOnLine”: 0
}
After Db.Save(obj) is executed the table field visualizzaOnLine is valued to 1 whilst numeroDecimali is valued to 4. I expect visualizzaOnLine valued to 0 as the json states.
visualizzaOnLine is missing in Db.LastCommandText whilst numeroDecimali is there.
Which is the right way to use Default attribute?