❔ How to calculate with numbers which are typed as object?
I have a function which gets a List<object> parameter. Several different sources are actually adding a value to the list, which might be anything from byte to decimal. Basicaly any buildin number type. Im trying to calculate using the values in the list, one after another. However its not possible to simply to "a + b" if both are only known as "object". I could ofcourse do 15 * 15 type checks (possible number types) for a and b, just to be able to sum them and get the appropriete result (int + int = int, int + float = float, ...). Is there any better solution to this at all? Help would be very appreciated!