narsil/Tanshu.Accounts.Repository/WaiterBI.cs
2014-10-16 16:45:03 +05:30

25 lines
688 B
C#

using System.Collections.Generic;
using NHibernate;
using Tanshu.Accounts.Entities;
using NHibernate.Criterion;
namespace Tanshu.Accounts.Repository
{
public class WaiterBI : UnitOfWork<Waiter>
{
public IList<Waiter> List(Dictionary<string, string> filter)
{
return _session.QueryOver<Waiter>()
.WhereRestrictionOn(x => x.Name).IsLike(string.Format("%{0}%", filter["Name"]))
.List();
}
public static IList<Waiter> StaticList(Dictionary<string, string> filter)
{
using (var bi = new WaiterBI())
{
return bi.List(filter);
}
}
}
}