CsDO.CodeGenerator.ClassDefinition.ToString C# (CSharp) Метод

ToString() публичный Метод

public ToString ( ) : string
Результат string
        public override string ToString()
        {
            return String.IsNullOrEmpty(alias) ? table : alias;
        }

Usage Example

Пример #1
0
        private CodeTypeDeclaration CreateClass(ClassDefinition table)
        {
            CodeTypeDeclaration type = new CodeTypeDeclaration();

            type.Name = table.ToString();
            type.IsClass = true;
            type.IsPartial = true;
            type.BaseTypes.Add(new CodeTypeReference(typeof(CsDO.Lib.DataObject)));
            type.CustomAttributes.Add(new CodeAttributeDeclaration("Serializable",
                    new CodeAttributeArgument[] { }));
            if (!String.IsNullOrEmpty(table.Alias) && !table.Table.Equals(table.Alias))
            {
                type.CustomAttributes.Add(new CodeAttributeDeclaration("Table",
                    new CodeAttributeArgument[] {
                            new CodeAttributeArgument(new CodePrimitiveExpression(table.Table))
                        }));
            }

            #region class comments
            type.Comments.AddRange(InsertDocumentation(Documetation.Remarks, new string[]
                {
                    "Persistence class that maps table '" + table + "'",
                    "Warning: Each property maps a column, use the attribute",
                    "Column to mark properties that should not be persisted."
                }));
            type.Comments.AddRange(InsertDocumentation(Documetation.SeeAlso, new string[] { "Column" }));
            #endregion

            return type;
        }