Пример #1
0
        public static CodeTypeDeclaration DefineProperties(this CodeTypeDeclaration codeTypeDeclaration, Type entityType)
        {
            codeTypeDeclaration.StartDirectives.Add(new CodeRegionDirective(CodeRegionMode.Start, "Properties"));


            foreach (PropertyInfo propertyInfo in entityType.GetInstanceProperties())
            {
                codeTypeDeclaration.DefineProperty(propertyInfo);
            }

            codeTypeDeclaration.EndDirectives.Add(new CodeRegionDirective(CodeRegionMode.End, string.Empty));
            return(codeTypeDeclaration);
        }