how to update property automatically in c# -


i have json object. want update lastupdate property whenever of other properties set (changed).

how can fix without calling lastupdate property calling function?

public class tickerdata {     public string symbol { get; set; }     public string exchange { get; set; }     public securitytype securitytype { get; set; }     public string  currency { get; set; } // convert enum later      public strategy  entrystrategy { get; set; }     public ohlcv ohlcv { get; set; }     public historicaldataeventargs[] historicaldata { get; set; }     public datetime date { get; set; }     public decimal open { get; set; }     public decimal high { get; set; }     public decimal low { get; set; }      public decimal close { get; set; }     public datetime lastupdate { get; set; } } 

it sounds more accomplish change tracking. i'm not sure how pure you're trying keep object, implement inotifypropertychanged maybe new caller information attributes in .net 4.5 - monitor changes properties , update lastupdate appropriately. read more here.


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -