本文整理汇总了C#中SessionScopeWrapper.CreateCriteria方法的典型用法代码示例。如果您正苦于以下问题:C# SessionScopeWrapper.CreateCriteria方法的具体用法?C# SessionScopeWrapper.CreateCriteria怎么用?C# SessionScopeWrapper.CreateCriteria使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SessionScopeWrapper
的用法示例。
在下文中一共展示了SessionScopeWrapper.CreateCriteria方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadKeyColumns
public IList<OrmKeyColumn> LoadKeyColumns(string tableName)
{
Guard.ArgumentNotNullOrEmptyString(tableName, "tableName");
using (ISession session = new SessionScopeWrapper())
{
return session.CreateCriteria(typeof (OrmKeyColumn))
.Add(Expression.Eq("TableName", tableName))
.List<OrmKeyColumn>();
}
}
示例2: LoadTableByName
private static OrmTable LoadTableByName(string tableName)
{
Guard.ArgumentNotNullOrEmptyString(tableName, "tableName");
using (ISession session = new SessionScopeWrapper())
{
IList<OrmTable> list = session.CreateCriteria(typeof (OrmTable))
.Add(Expression.Eq("TableName", tableName))
.List<OrmTable>();
return (list.Count > 0 ? list[0] : null);
}
}
示例3: LoadLookupByID
private static OrmLookup LoadLookupByID(string lookupId)
{
Guard.ArgumentNotNullOrEmptyString(lookupId, "lookupId");
using (ISession session = new SessionScopeWrapper())
{
IList<OrmLookup> list = session.CreateCriteria(typeof (OrmLookup))
.Add(Expression.Eq("LookupId", lookupId))
.List<OrmLookup>();
return (list.Count > 0 ? list[0] : null);
}
}
示例4: LoadLookups
private static IList<OrmLookup> LoadLookups(string tableName)
{
Guard.ArgumentNotNullOrEmptyString(tableName, "tableName");
using (ISession session = new SessionScopeWrapper())
{
return session.CreateCriteria(typeof (OrmLookup))
.Add(Expression.Eq("MainTable", tableName))
.List<OrmLookup>();
}
}
示例5: LoadColumn
private static OrmColumn LoadColumn(string tableName, string fieldName)
{
Guard.ArgumentNotNullOrEmptyString(tableName, "tableName");
Guard.ArgumentNotNullOrEmptyString(fieldName, "fieldName");
using (ISession session = new SessionScopeWrapper())
{
IList<OrmColumn> list = session.CreateCriteria(typeof (OrmColumn))
.Add(Expression.Eq("TableName", tableName))
.Add(Expression.Eq("FieldName", fieldName))
.List<OrmColumn>();
return (list.Count > 0 ? list[0] : null);
}
}
示例6: LoadCalculatedField
private static OrmCalculatedField LoadCalculatedField(string tableName, string fieldName)
{
Guard.ArgumentNotNullOrEmptyString(tableName, "tableName");
Guard.ArgumentNotNullOrEmptyString(fieldName, "fieldName");
using (ISession session = new SessionScopeWrapper())
{
IList<OrmCalculatedField> list = session.CreateCriteria(typeof (OrmCalculatedField))
.Add(Expression.Eq("TableName", tableName))
.Add(Expression.Like("CalculationData", string.Format("|{0}|", fieldName), MatchMode.Start))
.List<OrmCalculatedField>();
return (list.Count > 0 ? list[0] : null);
}
}
示例7: LoadTables
public IList<OrmTable> LoadTables()
{
using (ISession session = new SessionScopeWrapper())
{
return session.CreateCriteria(typeof (OrmTable))
.AddOrder(new Order("TableName", true))
.List<OrmTable>();
}
}
示例8: LoadProjects
public IList<OrmProject> LoadProjects()
{
using (ISession session = new SessionScopeWrapper())
{
return session.CreateCriteria(typeof (OrmProject))
.AddOrder(new Order("Name", true))
.List<OrmProject>();
}
}
示例9: LoadProject
public OrmProject LoadProject(string name)
{
Guard.ArgumentNotNullOrEmptyString(name, "name");
using (ISession session = new SessionScopeWrapper())
{
IList<OrmProject> list = session.CreateCriteria(typeof (OrmProject))
.Add(Expression.Eq("Name", name))
.List<OrmProject>();
return (list.Count > 0 ? list[0] : null);
}
}