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


C# Mapping.List类代码示例

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


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

示例1: CreateList

		private Mapping.Collection CreateList(XmlNode node, string prefix, string path,
			PersistentClass owner, System.Type containingType)
		{
			List list = new List(owner);
			BindCollection(node, list, prefix, path, containingType);
			return list;
		}
开发者ID:pallmall,项目名称:WCell,代码行数:7,代码来源:CollectionBinder.cs

示例2: PrimaryKeyModel

 public PrimaryKeyModel(List<Column> pkCols, bool identity, string name, bool clustered)
 {
     PkCols = pkCols;
     Identity = identity;
     Name = name;
     Clustered = clustered;
 }
开发者ID:jeffreyabecker,项目名称:NHMigrations,代码行数:7,代码来源:PrimaryKeyModel.cs

示例3: GetSlabInfoByTimeInterval

        public ISlabInfo[] GetSlabInfoByTimeInterval(long aFrom, long aTo)
        {
            try {
                using (var session = NHibernateHelper.OpenSession()) {
                    var entitys = session.CreateCriteria(typeof(SlabInfoEntity))
                    .Add(Restrictions.Between("StartScanTime", aFrom, aTo))
                    .List<SlabInfoEntity>();

                    var results = new List<ISlabInfo>();
                    foreach (var entity in entitys) {
                        results.Add(new SlabInfoImpl {
                            Id = entity.Id,
                            Number = entity.Number,
                            StandartSizeId = entity.StandartSizeId,
                            StartScanTime = entity.StartScanTime,
                            EndScanTime = entity.EndScanTime
                        });
                    }

                    return results.ToArray();
                }
            }
            catch (Exception ex) {
                logger.Error("Ошибка при чтении SlabInfo: " + ex.Message);
                return null;
            }
        }
开发者ID:desla,项目名称:SlabGeometryControl,代码行数:27,代码来源:NHibernateSlabInfoWriter.cs

示例4: Mapper

 public Mapper(Assembly[] assemblies)
 {
     _assemblies = assemblies;
     _conventions = new List<Convention>(12);
     _hiloInserts = new List<string>(20);
     AppendConventions();
 }
开发者ID:solyutor,项目名称:enhima,代码行数:7,代码来源:Mapper.cs

示例5: GetProperties

 public override PropertyDescriptorCollection GetProperties()
 {
     if (_properties == null)
     {
         bool hasEntityAttributes = false;
         _properties = base.GetProperties();
         var list = new List<PropertyDescriptor>();
         foreach (PropertyDescriptor descriptor in _properties)
         {
             List<Attribute> attrs = GetEntityMemberAttributes(descriptor).ToList();
             if (_metaDataAttributes.ContainsKey(descriptor.Name))
                 attrs.AddRange(_metaDataAttributes[descriptor.Name]);
             if (attrs.Any())
             {
                 hasEntityAttributes = true;
                 list.Add(new PropertyDescriptorWrapper(descriptor, attrs.ToArray()));
             }
             else
             {
                 list.Add(descriptor);
             }
         }
         if (hasEntityAttributes)
             _properties = new PropertyDescriptorCollection(list.ToArray(), true);
     }
     return _properties;
 }
开发者ID:OpenRIAServices,项目名称:OpenRiaServices,代码行数:27,代码来源:NHibernateTypeDescriptor.cs

示例6: CreateList

		private Mapping.Collection CreateList(XmlNode node, string prefix, string path,
			PersistentClass owner, System.Type containingType, IDictionary<string, MetaAttribute> inheritedMetas)
		{
			List list = new List(owner);
			BindCollection(node, list, prefix, path, containingType, inheritedMetas);
			return list;
		}
开发者ID:hazzik,项目名称:nh-contrib-everything,代码行数:7,代码来源:CollectionBinder.cs

示例7: ProcessIndex

		private void ProcessIndex(XmlElement indexElement, IDictionary<string, Table> tables)
		{
			var tableName = indexElement.GetAttribute("table");
			var columnNames = CollectionUtils.Map(indexElement.GetAttribute("columns").Split(','), (string s) => s.Trim());

			if (string.IsNullOrEmpty(tableName) || columnNames.Count <= 0)
				return;

			// get table by name
			Table table;
			if (!tables.TryGetValue(tableName, out table))
				throw new DdlException(
					string.Format("An additional index refers to a table ({0}) that does not exist.", table.Name),
					null);

			// get columns by name
			var columns = new List<Column>();
			foreach (var columnName in columnNames)
			{
				var column = CollectionUtils.SelectFirst(table.ColumnIterator, col => col.Name == columnName);
				// bug #6994: could be that the index file specifies a column name that does not actually exist, so we need to check for nulls
				if (column == null)
					throw new DdlException(
						string.Format("An additional index on table {0} refers to a column ({1}) that does not exist.", table.Name, columnName),
						null);
				columns.Add(column);
			}

			// create index
			CreateIndex(table, columns);
		}
开发者ID:nhannd,项目名称:Xian,代码行数:31,代码来源:AdditionalIndexProcessor.cs

示例8: SqlTriggerBody

        public override string SqlTriggerBody(
      Dialect dialect, IMapping p, 
      string defaultCatalog, string defaultSchema)
        {
            var auditTableName = dialect.QuoteForTableName(_auditTableName);
              var eDialect = (IExtendedDialect)dialect;

              string triggerSource = _action == TriggerActions.DELETE ?
            eDialect.GetTriggerOldDataAlias() :
            eDialect.GetTriggerNewDataAlias();

              var columns = new List<string>(_dataColumnNames);
              columns.AddRange(from ac in _auditColumns
                       select ac.Name);

              var values = new List<string>();
              values.AddRange(
            from columnName in _dataColumnNames
            select eDialect.QualifyColumn(
              triggerSource, columnName));
              values.AddRange(
            from auditColumn in _auditColumns
            select auditColumn.ValueFunction.Invoke(_action));

              return eDialect.GetInsertIntoString(auditTableName,
            columns, triggerSource, values);
        }
开发者ID:akhuang,项目名称:NHibernate,代码行数:27,代码来源:AuditTrigger.cs

示例9: ObtenerPorNombre

        public static IList<Proyecto> ObtenerPorNombre(String nombre)
        {
            IList<Proyecto> proyecto = new List<Proyecto>();

            try
            {

                using (ISession session = Persistencia.SessionFactory.OpenSession())
                {
                    ICriteria criteria = session.CreateCriteria<Proyecto>();
                    criteria.Add(
                    Expression.Like("Nombre", nombre, MatchMode.Anywhere) /*||
                    Expression.Like("Responsable", nombre, MatchMode.Anywhere) ||
                    Expression.Like("TipoPrograma", nombre, MatchMode.Anywhere) ||
                    Expression.Like("Sector", nombre, MatchMode.Anywhere) ||
                    Expression.Like("Giro", nombre, MatchMode.Anywhere) ||
                    Expression.Like("Empresa", nombre, MatchMode.Anywhere) ||
                    Expression.Like("Telefono", nombre, MatchMode.Anywhere) ||
                    Expression.Like("Periodo", nombre, MatchMode.Anywhere) ||
                    Expression.Like("Horario", nombre, MatchMode.Anywhere) ||
                    Expression.Like("Horas", nombre, MatchMode.Anywhere)*/);
                    proyecto = criteria.List<Proyecto>();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return proyecto;
        }
开发者ID:jahazielhigareda,项目名称:ServicioSocial,代码行数:30,代码来源:ProyectoNegocio.cs

示例10: CreateList

		private Mapping.Collection CreateList(HbmList listMapping, string prefix, string path,
			PersistentClass owner, System.Type containingType, IDictionary<string, MetaAttribute> inheritedMetas)
		{
			var list = new List(owner);
			BindCollection(listMapping, list, prefix, path, containingType, inheritedMetas);
			AddListSecondPass(listMapping, list, inheritedMetas);
			return list;
		}
开发者ID:NikGovorov,项目名称:nhibernate-core,代码行数:8,代码来源:CollectionBinder.cs

示例11: viewroots

 public void viewroots() {
     var result = new List<string>();
     result.Add(MonoRailConfiguration.GetConfig().ViewEngineConfig.ViewPathRoot);
    
     foreach (var path in MonoRailConfiguration.GetConfig().ViewEngineConfig.PathSources) {
         result.Add(path);
     }
     PropertyBag["result"] = result;
 }
开发者ID:Qorpent,项目名称:comdiv.oldcore,代码行数:9,代码来源:SysInfoController.cs

示例12: GetObjects

 public System.Collections.IList GetObjects(string hql)
 {
     using (var factory = CreateSessionFactory(connectionString))
     using (var session = factory.OpenSession())
     {
         List<object> results = new List<object>();
         var query = session.CreateQuery(hql);
         query.List(results);
         return results;
     }
 }
开发者ID:kamchung322,项目名称:eXpand,代码行数:11,代码来源:PersistenceManager.cs

示例13: FeelProducts

 public static List<Products> FeelProducts()
 {
     List<Products> result = new List<Products>
     {
         new Products{ Id = 1, Name = "LG", Declarations = "bla bla bla"},
         new Products{ Id = 2, Name = "Sumsung", Declarations = "bla bla bla"},
         new Products{ Id = 3, Name = "Apple", Declarations = "bla bla bla"},
         new Products{ Id = 4, Name = "Sony", Declarations = "bla bla bla"}
     };
     return result;
 }
开发者ID:Baidullayev,项目名称:onlineShop,代码行数:11,代码来源:Feeler.cs

示例14: GetContentList

        public List<DiskContentModel> GetContentList(Directories dir)
        {
            var listOfDirectories = dir.SubFolder.ToList();
            var listOfContent = new List<DiskContentModel>();

            foreach (var dirs in listOfDirectories)
            {
                listOfContent.Add(Mapper.Map<Directories, DiskContentModel>(dirs));
            }
            return listOfContent;
        }
开发者ID:Edalzebu,项目名称:MiniDropbox,代码行数:11,代码来源:DiskController.cs

示例15: InitMap

 /// <summary>
 /// Populate the metadata header.
 /// </summary>
 void InitMap()
 {
     _map = new Dictionary<string, object>();
     _typeList = new List<Dictionary<string, object>>();
     _typeNames = new HashSet<string>();
     _resourceMap = new Dictionary<string, object>();
     _fkMap = new Dictionary<string, string>();
     _map.Add("localQueryComparisonOptions", "caseInsensitiveSQL");
     _map.Add("structuralTypes", _typeList);
     _map.Add("resourceEntityTypeMap",_resourceMap);
     _map.Add(FK_MAP, _fkMap);
 }
开发者ID:Rickinio,项目名称:breeze.server.net,代码行数:15,代码来源:NHBreezeMetadata.cs


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