• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IClassMap类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: GenerateDLinqField

 public static void GenerateDLinqField(IClassMap classMap, IPropertyMap propertyMap, CodeTypeDeclaration classDecl)
 {
     switch (propertyMap.ReferenceType)
     {
         case ReferenceType.None :
             classDecl.Members.Add(GenerateDLinqPrimitiveField(classMap, propertyMap));
         break;
         case ReferenceType.OneToMany :
             GenerateDLinqOneToManyFields(classMap, propertyMap, classDecl);
         break;
     }
 }
开发者ID:BackupTheBerlios,项目名称:puzzle-svn,代码行数:12,代码来源:CodeDomGenerator.cs


示例17: ConcreteClassMapBuilder

        public ConcreteClassMapBuilder(IClassMap classMap)
        {
            _classMap = classMap;
            _instance = classMap.CreateInstance();

            if(!_classMap.HasExtendedProperties)
                return;
            
            var extPropType = _classMap.ExtendedPropertiesMap.MemberReturnType;
            if (extPropType == typeof(IDictionary<string, object>))
                extPropType = typeof(Dictionary<string, object>);
            _extendedProperties = (IDictionary<string, object>)Activator.CreateInstance(extPropType);
            _classMap.ExtendedPropertiesMap.SetValue(_instance, _extendedProperties);
        }
开发者ID:gaoninggn,项目名称:mongodb-csharp,代码行数:14,代码来源:ConcreteClassMapBuilder.cs


示例18: GetDataSet

 public static PluginOutput GetDataSet(IClassMap classMap)
 {
     Assembly domainAssembly = GetDomain(classMap.DomainMap);
     if (domainAssembly != null)
     {
         List<DataTable> dtList = new List<DataTable>();
         dtList.Add(ClassToTable(classMap.DomainMap, domainAssembly, classMap.Name));
         string res = GetDataSet(dtList, classMap.DomainMap.Name + "DataSet");
         res = res.Replace(domainAssembly.FullName, classMap.DomainMap.AssemblyName);
         return new PluginOutput(res, classMap.DomainMap.Name + "DataSet");
     }
     else
         throw new Exception("Could not compile domain model !");
 }
开发者ID:BackupTheBerlios,项目名称:puzzle-svn,代码行数:14,代码来源:DataSetGenerator.cs


示例19: GenerateFactoryMethods

		public static void GenerateFactoryMethods(IClassMap classMap, CodeTypeDeclaration classDecl)
		{
			IList propertyMaps = GetRequiredPropertyMaps(classMap);
			classDecl.Members.Add(GenerateFactoryMethod(classMap, propertyMaps));					

			IList optionalPropertyMaps = GetOptionalPropertyMaps(classMap);
			if (optionalPropertyMaps.Count > 0)
			{
				foreach (IPropertyMap propertyMap in optionalPropertyMaps)
					propertyMaps.Add(propertyMap);

				classDecl.Members.Add(GenerateFactoryMethod(classMap, propertyMaps));					
			}
		}
开发者ID:Dawn-of-Light,项目名称:Puzzle.NET,代码行数:14,代码来源:CodeDomGenerator.cs


示例20: LoadFile

		//non-cached
		protected virtual string LoadFile(object obj, IClassMap classMap, string fileName)
		{
			this.Context.LogManager.Debug(this, "Loading object from file", "File: " + fileName + ", Object Type: " + obj.GetType().ToString()); // do not localize

			if (!(File.Exists(fileName)))
				return "";
			else
			{
				StreamReader fileReader = File.OpenText(fileName);
				string xml =  fileReader.ReadToEnd() ;
				fileReader.Close();

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IClassMapper类代码示例发布时间:2022-05-24
下一篇:
C# IClassDef类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap