I'm having a play with .NET 5.0 RC1 and C# 9.0... ...
# dotnet
w
I'm having a play with .NET 5.0 RC1 and C# 9.0... I think the improved target typing will help reduce ceremony:
Copy code
var cluster = new Cluster($"{prefix}-cluster",
    new ClusterArgs
    {
        RoleArn = clusterRole.Arn,
        Version = config.KubeVersion,
        VpcConfig = new ClusterVpcConfigArgs { SubnetIds = subnetIds }
    },
    new CustomResourceOptions { DependsOn = clusterPolicies });
becomes:
Copy code
var cluster = new Cluster($"{prefix}-cluster",
    new()
    {
        RoleArn = clusterRole.Arn,
        Version = config.KubeVersion,
        VpcConfig = new ClusterVpcConfigArgs { SubnetIds = subnetIds }
    },
    new() { DependsOn = clusterPolicies });
But there is a problem that
Input<T>
types don't play nice. For example, trying to remove
ClusterVpcConfigArgs
above causes a compiler error: