Example #1
0
        public Class Convert(Table table)
        {
            Class @class = new Class {
                Name       = table.Name.Proper(),
                Properties = from item in table.Columns select new Property(item.Name.Proper())
                {
                    Type     = getDotNetType.Convert(item.Type),
                    Modifier = AccessModifier.Public,
                },
            };

            return(@class);
        }
Example #2
0
        Method GetCreateMethod(Procedure procedure)
        {
            Method method = new Method("Create")
            {
                ReturnType = new DotNetType("Dapper.CommandDefinition"),
                Parameters = from sqlParam
                             in procedure.Parameters
                             select new Albatross.CodeGen.CSharp.Model.Parameter(Extension.VariableName(sqlParam.Name))
                {
                    Type = getDotNetType.Convert(sqlParam.Type),
                },
            };

            method.Body = new CodeBlock("DynamicParameters dynamicParameters = new DynamicParameters();\nreturn new CommandDefinition(dbConnection,);");
            return(method);
        }