Complex to implement IConvertible
See original GitHub issueHi,
I have a scenario where the return type of a formula is not known in advance. Hence, I would like to write something like this :
Type t = GetTheReturnType(); // ex: typeof(int)
return Convert.ChangeType(resultAsComplex.ToNumber(), t);
This would require the Complex type to implement IConvertible.
public partial record Complex : Number, IConvertible
I noticed that implicit operators for conversion are already in place so implementing the interface is feasible. Anyone has some feedback on this proposition ?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
IConvertible Interface (System)
Defines methods that convert the value of the implementing reference or value type to a common language runtime type that has an equivalent...
Read more >c# - Implementing IConvertible interface
I have custom type named LocalizedString and I need to implement IConvertible interface since when we serialize types to our DB we use ......
Read more >How to implement IConvertible interface
IConvertible interface defines methods that convert the current instance to a language runtime type. using System;//from j a v a 2s .c o...
Read more >Object must implement IConvertible in Power Apps
So taking “Object must implement IConvertible” back into Power Platform language: The TextInput control returns information that cannot be used ...
Read more >IConvertable exception
I've faced with a problem on binding XRSubreport parameters. Steps to reproduce: Create Subreport with one parameter "TypeParm" (complex value).
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes that is what I did.
Alright, let’s keep the issue here for now, until it’s 100% clear. @tongbong, for now you can apply the idea with an extension method for your project.