Elixir/Phoenix-like C#

I’ve not been able to work with Elixir for a while, instead having to jump over to Windows, C# and .NET Core.

Just caught myself writing this…

public async Task<FormModel> GetFormWithSubject(string formCode, string subjectPrimaryKey)
        {
            FormModel Form = new FormModel(formCode);

            using (var conn = new SqlConnection(_connectionString))
            {
                conn.Open();
                Form = await LoadFormAndFields(conn, Form);
                Form = await LoadSubject(conn, Form, subjectPrimaryKey);
            }

            return Form;
        }

Fair to say I’m missing piping and the way that Phoenix passes around it’s conn! :rofl: I don’t even need the assignments to Form but I’m so used to immutable data that it looks plain wrong without them.

Between working with C# and Swift lately I’ve come to appreciate a great deal about Elixir!

4 Likes