This message was deleted.
# azure
s
This message was deleted.
t
NOTE: This all happens before any resources are created, but due to
Input
and
Output
casts, I can't accomplish what should be easily achievable.
Still looking for help on merging `InputList`'s.
t
Copy code
var merged = args.SiteConfig
    .Apply(c => c.AppSettings.ToOutput())
    .Apply(settings =>
        Output.All(settings.Select(s => Output.Tuple(s.Name, s.Value))))
    .Apply(settings =>
    {
        var dict = new Dictionary<string, string>(defaultAppSettings);
        foreach (var (k, v) in settings)
            dict[k] = v;
        return dict.Select(kv => new NameValuePairArgs {Name = kv.Key, Value = kv.Value});
    });
args.SiteConfig.Apply(s => s.AppSettings = merged);
🙌 1
I’m not really proud of writing this code…
t
Wow
Input
/
Output
is pretty slick. But man can it be annoying at the same time. 🙂
Would it be possible to have something like this:
Copy code
var value = "someValue";
Input<T> inputValue = value;
var newValue = inputValue.Value;
Assert.Equal(value, newValue);
Maybe
Input<T>.Value
is only non-null if it was implicitly cast from type T
Copy code
class Input<T>
{
	public T? Value;
	public static implicit operator Input<T>([MaybeNull]T value)
	{
		Value = value;
		return Output.Create(value);
	}
}
t
Maybe we could. I think something like that is possible in node.