❔ Getter on code dom

Hey, I am looking to have something like get => uwu["x"]; on the last line. Is there a way to do thaht ?

            var x = new CodeMemberField(typeof(Dictionary<string, Dictionary<string, string>>), "uwu");
            x.InitExpression = new CodeObjectCreateExpression(typeof(Dictionary<string, Dictionary<string, string>>));
            class1.Members.Add(x);
            
            var f = new CodeMemberProperty();
            f.Name = "fr";
            f.GetStatements.Add(new CodeMethodReturnStatement(new CodePrimitiveExpression(x.Name)));
Was this page helpful?