|
|
|
|
|
by lloydjatkinson
3294 days ago
|
|
Very similar to something I'm working on. Except in my case I have an interface that the consumers implement to be able to talk to their service/database/whatever. It's designed for time series data (e.g., cpu usage, room temperature, that kind of thing). It's meant to only allow for numeric values and strings. But because there is no base type or interface for numeric types I unfortunately can't do something like: public Result WriteValue<T>(T value) where T : INumeric/Numeric { }
https://stackoverflow.com/questions/32664/is-there-a-constra...:( So instead the interface has an identical method for ints, doubles, floats, decimals, strings... |
|
http://referencesource.microsoft.com/#mscorlib/system/double...