private static CodeMemberProperty GenerateCatalogTableProperty(DataTable dataTable)
        {
            CodeMemberProperty propDecl = new CodeMemberProperty();

            propDecl.Attributes = MemberAttributes.Public | MemberAttributes.Final;
            propDecl.Name       = GetCatalogTablePropertyName(dataTable);
            propDecl.HasGet     = true;
            propDecl.HasSet     = true;

            propDecl.Type = new CodeTypeReference(typeof(DbSet <>));
            propDecl.Type.TypeArguments.Add(new CodeTypeReference(CatalogTableTypeGenerator.GetTypeName(dataTable)));

            propDecl.GetStatements.Add(
                new CodeMethodReturnStatement(
                    new CodeFieldReferenceExpression(
                        new CodeThisReferenceExpression(), GetCatalogTableFieldName(dataTable))));

            propDecl.SetStatements.Add(
                new CodeAssignStatement(
                    new CodeFieldReferenceExpression(
                        new CodeThisReferenceExpression(),
                        GetCatalogTableFieldName(dataTable)),
                    new CodePropertySetValueReferenceExpression()));

            return(propDecl);
        }
        private static CodeMemberField GenerateCatalogTableField(DataTable dataTable)
        {
            CodeMemberField fieldDecl = new CodeMemberField();

            fieldDecl.Attributes = MemberAttributes.Private;
            fieldDecl.Name       = GetCatalogTableFieldName(dataTable);
            fieldDecl.Type       = new CodeTypeReference(typeof(DbSet <>));
            fieldDecl.Type.TypeArguments.Add(new CodeTypeReference(CatalogTableTypeGenerator.GetTypeName(dataTable)));

            return(fieldDecl);
        }