コード例 #1
0
        private void AppendedFieldEnum()
        {
            var imageColumnList = _item.GetColumnsByType(System.Data.SqlDbType.Image).OrderBy(x => x.Name).ToList();

            if (imageColumnList.Count != 0)
            {
                sb.AppendLine("	#region " + _item.PascalName + "FieldImageConstants Enumeration");
                sb.AppendLine();
                sb.AppendLine("	/// <summary>");
                sb.AppendLine("	/// An enumeration of this object's image type fields");
                sb.AppendLine("	/// </summary>");
                sb.AppendLine("	public enum " + _item.PascalName + "FieldImageConstants");
                sb.AppendLine("	{");
                foreach (var column in imageColumnList)
                {
                    sb.AppendLine("		/// <summary>");
                    sb.AppendLine("		/// Field mapping for the image parameter '"+ column.PascalName + "' property" + (column.PascalName != column.DatabaseName ? " (Database column: " + column.DatabaseName + ")" : string.Empty));
                    sb.AppendLine("		/// </summary>");
                    sb.AppendLine("		[System.ComponentModel.Description(\"Field mapping for the image parameter '"+ column.PascalName + "' property\")]");
                    sb.AppendLine("		"+ column.PascalName + ",");
                }
                sb.AppendLine("	}");
                sb.AppendLine();
                sb.AppendLine("	#endregion");
                sb.AppendLine();
            }

            sb.AppendLine("	#region " + _item.PascalName + "FieldNameConstants Enumeration");
            sb.AppendLine();
            sb.AppendLine("	/// <summary>");
            sb.AppendLine("	/// Enumeration to define each property that maps to a database field for the '" + _item.PascalName + "' table.");
            sb.AppendLine("	/// </summary>");
            sb.AppendLine("	public enum " + _item.PascalName + "FieldNameConstants");
            sb.AppendLine("	{");
            foreach (var column in _item.GeneratedColumns)
            {
                sb.AppendLine("		/// <summary>");
                sb.AppendLine("		/// Field mapping for the '"+ column.PascalName + "' property" + (column.PascalName != column.DatabaseName ? " (Database column: " + column.DatabaseName + ")" : string.Empty));
                sb.AppendLine("		/// </summary>");
                sb.AppendLine("		[System.ComponentModel.Description(\"Field mapping for the '"+ column.PascalName + "' property\")]");
                sb.AppendLine("		"+ column.PascalName + ",");
            }

            sb.AppendLine("	}");
            sb.AppendLine("	#endregion");
            sb.AppendLine();
        }
コード例 #2
0
        private void AppendedFieldEnum()
        {
            var imageColumnList = _item.GetColumnsByType(System.Data.SqlDbType.Image);

            if (imageColumnList.Count() != 0)
            {
                sb.AppendLine("		#region FieldNameConstants Enumeration");
                sb.AppendLine();
                sb.AppendLine("		/// <summary>");
                sb.AppendLine("		/// An enumeration of this object's image type fields");
                sb.AppendLine("		/// </summary>");
                sb.AppendLine("		public enum FieldImageConstants");
                sb.AppendLine("		{");
                foreach (var column in imageColumnList)
                {
                    sb.AppendLine("			/// <summary>");
                    sb.AppendLine("			/// Field mapping for the image column '"+ column.PascalName + "' property");
                    sb.AppendLine("			/// </summary>");
                    sb.AppendLine("			[System.ComponentModel.Description(\"Field mapping for the image column '"+ column.PascalName + "' property\")]");
                    sb.AppendLine("			"+ column.PascalName + ",");
                }
                sb.AppendLine("		}");
                sb.AppendLine();
                sb.AppendLine("		#endregion");
                sb.AppendLine();
            }

            sb.AppendLine("		#region FieldNameConstants Enumeration");
            sb.AppendLine();
            sb.AppendLine("		/// <summary>");
            sb.AppendLine("		/// Enumeration to define each property that maps to a database field for the '"+ _item.PascalName + "' view.");
            sb.AppendLine("		/// </summary>");
            sb.AppendLine("		public enum FieldNameConstants");
            sb.AppendLine("		{");
            foreach (var column in _item.GeneratedColumns)
            {
                sb.AppendLine("			/// <summary>");
                sb.AppendLine("			/// Field mapping for the '"+ column.PascalName + "' property");
                sb.AppendLine("			/// </summary>");
                sb.AppendLine("			[System.ComponentModel.Description(\"Field mapping for the '"+ column.PascalName + "' property\")]");
                sb.AppendLine("			"+ column.PascalName + ",");
            }

            sb.AppendLine("		}");
            sb.AppendLine("		#endregion");
            sb.AppendLine();
        }