本文整理汇总了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;
}
示例2: PrimaryKeyModel
public PrimaryKeyModel(List<Column> pkCols, bool identity, string name, bool clustered)
{
PkCols = pkCols;
Identity = identity;
Name = name;
Clustered = clustered;
}
示例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;
}
}
示例4: Mapper
public Mapper(Assembly[] assemblies)
{
_assemblies = assemblies;
_conventions = new List<Convention>(12);
_hiloInserts = new List<string>(20);
AppendConventions();
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}
示例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);
}