当前位置: 首页>>代码示例>>C#>>正文


C# IClassMap类代码示例

本文整理汇总了C#中IClassMap的典型用法代码示例。如果您正苦于以下问题:C# IClassMap类的具体用法?C# IClassMap怎么用?C# IClassMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IClassMap类属于命名空间,在下文中一共展示了IClassMap类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GenerateFindByMethods

		/// <summary>
		/// Generates all the 'find by' methods of this interface.
		/// </summary>
		/// <param name="classMap">The class map.</param>
		/// <param name="file">The file.</param>
		private static void GenerateFindByMethods(IClassMap classMap, StreamWriter file)
		{
			foreach (KeyValuePair<int, IList<IPropertyMap>> pair in classMap.DOLGetFindByGroups())
			{
				IList<IPropertyMap> paramProps = pair.Value;
				
				string findBy = StringUtility.CombineObjects(paramProps, MapToStringConverters.PropertyAnd)
					.ToString();
				
				// method name
				file.Write("		IList<" + EntityGenerator.GetTypeName(classMap) + "> FindBy" + findBy);
				
				// method's params
				file.Write("(");
				bool first = true;
				foreach (IPropertyMap propertyMap in paramProps)
				{
					if (!first)
					{
						file.Write(", ");
					}
						
					// param type and name
					string paramName = ClassUtility.GetParamName(propertyMap);
					string paramType = ClassUtility.ConvertColumnTypeToCsType(propertyMap.GetColumnMap().DataType);
					file.Write(paramType + " " + paramName);
					first = false;
				}
				file.Write(");");
					
				file.WriteLine();

			}
		}
开发者ID:Dawn-of-Light,项目名称:Puzzle.NET,代码行数:39,代码来源:DataAccessInterfaceGenerator.cs

示例2: GenerateDai

		/// <summary>
		/// Generates the DAO interface file.
		/// </summary>
		/// <param name="path">The path.</param>
		/// <param name="classMap">The class map.</param>
		private static void GenerateDai(string path, IClassMap classMap)
		{
			
			using (StreamWriter file = new StreamWriter(path + GetInterfaceName(classMap) + ".cs", false))
			{
				ClassUtility.AppendHeader(file);
				
				file.WriteLine("using System.Collections.Generic;");
				file.WriteLine("using DOL.Database.DataTransferObjects;");
				file.WriteLine();

				file.WriteLine("namespace DOL.Database.DataAccessInterfaces");
				file.WriteLine("{");
				file.WriteLine("	public interface " + GetInterfaceName(classMap) + " : IGenericDao<" + EntityGenerator.GetTypeName(classMap) + ">");
				file.WriteLine("	{");

				// generate 'find' methods
				GenerateFindMethods(classMap, file);

				// generate 'find by' methods
				GenerateFindByMethods(classMap, file);
				
				// generate 'cout by' methods
				GenerateCountByMethods(classMap, file);

				file.WriteLine("	}");
				file.WriteLine("}");
			}
		}
开发者ID:Dawn-of-Light,项目名称:Puzzle.NET,代码行数:34,代码来源:DataAccessInterfaceGenerator.cs

示例3: GenerateProperties

		/// <summary>
		/// Generates the public access properties.
		/// </summary>
		/// <param name="file">The file.</param>
		/// <param name="classMap">The class map.</param>
		private static void GenerateProperties(StreamWriter file, IClassMap classMap)
		{
			foreach (IPropertyMap property in classMap.PropertyMaps)
			{
				ClassUtility.GenerateProperty(file, property, false);
			}
		}
开发者ID:Dawn-of-Light,项目名称:Puzzle.NET,代码行数:12,代码来源:EntityGenerator.cs

示例4: GeneratePrivateFields

		/// <summary>
		/// Generates the private fields of the entity.
		/// </summary>
		/// <param name="file">The file.</param>
		/// <param name="classMap">The class map.</param>
		private static void GeneratePrivateFields(StreamWriter file, IClassMap classMap)
		{
			foreach (IPropertyMap property in classMap.PropertyMaps)
			{
				ClassUtility.GenerateField(file, property);
			}
		}
开发者ID:Dawn-of-Light,项目名称:Puzzle.NET,代码行数:12,代码来源:EntityGenerator.cs

示例5: GetParameterName

 protected override string GetParameterName(IClassMap classMap, string prefix)
 {
     string name = prefix;
     name = name + classMap.Name;
     name = ":" + name;
     return name;
 }
开发者ID:BackupTheBerlios,项目名称:puzzle-svn,代码行数:7,代码来源:SqlEngineOracle.cs

示例6: GetFactoryClassCompileUnit

		public static CodeCompileUnit GetFactoryClassCompileUnit(IClassMap classMap)
		{			
			CodeCompileUnit codeCompileUnit = new CodeCompileUnit();

			codeCompileUnit.Namespaces.Add(GenerateFactoryClass(classMap));

			return codeCompileUnit ;
		}
开发者ID:Dawn-of-Light,项目名称:Puzzle.NET,代码行数:8,代码来源:CodeDomGenerator.cs

示例7: DocumentClassMapPropertyDescriptor

        /// <summary>
        /// Initializes a new instance of the <see cref="DocumentClassMapPropertyDescriptor"/> class.
        /// </summary>
        /// <param name="mappingStore">The mapping store.</param>
        /// <param name="classMap">The class map.</param>
        /// <param name="document">The document.</param>
        public DocumentClassMapPropertyDescriptor(IMappingStore mappingStore, IClassMap classMap, Document document)
            : base(mappingStore, classMap)
        {
            if (document == null)
                throw new ArgumentNullException("document");

            _document = document;
        }
开发者ID:gaoninggn,项目名称:mongodb-csharp,代码行数:14,代码来源:DocumentClassMapPropertyDescriptor.cs

示例8: AliasForTable

        public string AliasForTable(IClassMap classMap)
        {
            if (classMap != null)
                foreach (var pair in _classMaps)
                    if (pair.Value == classMap)
                        return pair.Key;

            return String.Format("t_{0}", _tIndex++);
        }
开发者ID:viteyka,项目名称:Viteyka.ORM,代码行数:9,代码来源:QueryContext.cs

示例9: ExampleClassMapPropertyDescriptor

        /// <summary>
        /// Initializes a new instance of the <see cref="ExampleClassMapPropertyDescriptor"/> class.
        /// </summary>
        /// <param name="mappingStore">The mapping store.</param>
        /// <param name="classMap">The class map.</param>
        /// <param name="example">The example.</param>
        public ExampleClassMapPropertyDescriptor(IMappingStore mappingStore, IClassMap classMap, object example)
            : base(mappingStore, classMap)
        {
            if (example == null)
                throw new ArgumentNullException("example");

            _example = example;
            _exampleType = _example.GetType();
        }
开发者ID:dominiqueplante,项目名称:mongodb-csharp,代码行数:15,代码来源:ExampleClassMapPropertyDescriptor.cs

示例10: SqlEmitter

		public SqlEmitter(INPathEngine npathEngine, NPathSelectQuery query,NPathQueryType queryType, IClassMap rootClassMap, Hashtable propertyColumnMap)
		{
			this.npathEngine = npathEngine;
			this.query = query;
			this.rootClassMap = rootClassMap;
			propertyPathTraverser = new PropertyPathTraverser(this);
			this.propertyColumnMap = propertyColumnMap;
			this.npathQueryType = queryType;
		}
开发者ID:Dawn-of-Light,项目名称:Puzzle.NET,代码行数:9,代码来源:SqlEmitter.cs

示例11: MustGetTypeFromClassMap

		public virtual Type MustGetTypeFromClassMap(IClassMap classMap)
		{
			Type type = GetTypeFromClassMap(classMap);

			if (type == null)
				throw new MappingException("Could not find the type for the class " + classMap.Name + " (found in the map file) in any loaded Assembly!");
 
			return type;
		}
开发者ID:Dawn-of-Light,项目名称:Puzzle.NET,代码行数:9,代码来源:AssemblyManager.cs

示例12: ClassMapPropertyDescriptor

        /// <summary>
        /// Initializes a new instance of the <see cref="ClassMapPropertyDescriptor"/> class.
        /// </summary>
        /// <param name="mappingStore">The mapping store.</param>
        /// <param name="classMap">The class map.</param>
        /// <param name="instance">The instance.</param>
        public ClassMapPropertyDescriptor(IMappingStore mappingStore, IClassMap classMap, object instance)
            : base(mappingStore, classMap)
        {
            if (instance == null)
                throw new ArgumentNullException("instance");

            _instance = instance;
            if (ClassMap.HasExtendedProperties)
                _extendedProperties = (IDictionary<string, object>)ClassMap.ExtendedPropertiesMap.GetValue(instance);
        }
开发者ID:nisbus,项目名称:mongodb-csharp,代码行数:16,代码来源:ClassMapPropertyDescriptor.cs

示例13: GetRepositoryClassCsharp

        public static string GetRepositoryClassCsharp(IClassMap classMap)
        {
            CodeCompileUnit compileunit = CodeDomGenerator.GetRepositoryClassCompileUnit(classMap);

            CodeDomProvider provider = new CSharpCodeProvider();

            string code = CodeDomGenerator.ToCode(compileunit, provider);

            return code;
        }
开发者ID:BackupTheBerlios,项目名称:puzzle-svn,代码行数:10,代码来源:CSharpGenerator.cs

示例14: GenerateCustomFieldsAndMethods

		/// <summary>
		/// Generates custom fields and methods of the class.
		/// </summary>
		/// <param name="file">The file.</param>
		/// <param name="classMap">The class map.</param>
		public override void GenerateCustomFieldsAndMethods(StreamWriter file, IClassMap classMap)
		{
			ArrayList		allColumns = classMap.GetTableMap().ColumnMaps;
			IColumnMap[]	allColumnsTyped = (IColumnMap[]) allColumns.ToArray(typeof (IColumnMap));
			string			columnNames = StringUtility.CombineObjects(allColumnsTyped, MapToStringConverters.Columns).ToString();

			file.WriteLine("		protected static readonly string c_rowFields = \"" + columnNames + "\";");
			
			base.GenerateCustomFieldsAndMethods(file, classMap);
		}
开发者ID:Dawn-of-Light,项目名称:Puzzle.NET,代码行数:15,代码来源:MySqlDataAccessObjectGenerator.cs

示例15: ClassMapPropertyDescriptorBase

        /// <summary>
        /// Initializes a new instance of the <see cref="ClassMapPropertyDescriptorBase"/> class.
        /// </summary>
        /// <param name="mappingStore">The mapping store.</param>
        /// <param name="classMap">The class map.</param>
        protected ClassMapPropertyDescriptorBase(IMappingStore mappingStore, IClassMap classMap)
        {
            if (mappingStore == null)
                throw new ArgumentNullException("mappingStore");
            if (classMap == null)
                throw new ArgumentNullException("classMap");

            _mappingStore = mappingStore;
            ClassMap = classMap;
            _codeReplacer = new JavascriptMemberNameReplacer(_mappingStore);
        }
开发者ID:gaoninggn,项目名称:mongodb-csharp,代码行数:16,代码来源:ClassMapPropertyDescriptorBase.cs


注:本文中的IClassMap类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。