You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One major (and easy to fix, I presume) nuisance is that we can't pass non-string objects into the .Expand() function.
For example, this breaks at run-time:
intage=5;"I am {age} years old".Expand(age);
instead we currently have to manually call .ToString():
intage=5;"I am {age} years old".Expand(age.ToString());
If you could change .Expand to take params Object[] args, and the just call .ToString() automatically on each parameter passed in, it would avoid us having to do it manually everywhere.
Thanks!
The text was updated successfully, but these errors were encountered:
Thanks for posting this. I can certainly look at making this change. In the meantime, since Expansive simply gets installed as a single .cs file in your project, you should be able to make this change on your end until I can update the NuGet package.
I went to go ahead and make this change, but it looks like the signature I would use is already in use:
public static string Expand(this string source, params object[] models)
And I'm not really sure what this "models" function is used for?
Basically I was just going to have public static string Expand(this string source, params object[] args) call .ToString() on each of the args and forward it off to the public static string Expand(this string source, params string[] args) function.
First off, this is a great library. Thanks!
One major (and easy to fix, I presume) nuisance is that we can't pass non-string objects into the .Expand() function.
For example, this breaks at run-time:
instead we currently have to manually call .ToString():
If you could change .Expand to take
params Object[] args
, and the just call .ToString() automatically on each parameter passed in, it would avoid us having to do it manually everywhere.Thanks!
The text was updated successfully, but these errors were encountered: