narsil/Tanshu.Accounts.Repository/BusinessLayer/CustomerBI.cs
unknown 59909a5ee7 Updated NH, Code Refactoring, made all DB transactions atomic.
Must use the Repositories with Using or else bad things will happen.
2011-06-30 01:57:07 +05:30

31 lines
885 B
C#

using System.Collections.Generic;
using NHibernate;
using Tanshu.Accounts.Entities;
namespace Tanshu.Accounts.Repository
{
public class CustomerBI : FluentGenericBase<Customer>
{
public CustomerBI()
: base()
{ }
public CustomerBI(bool beginTransaction)
: base(beginTransaction)
{ }
public CustomerBI(ISession session)
: base(session)
{ }
public CustomerBI(ISession session, bool beginTransaction)
: base(session, beginTransaction)
{ }
public static IList<Customer> List(Dictionary<string, string> filter)
{
using (var bi = new CustomerBI(false))
return bi.Query()
.WhereRestrictionOn(x => x.Name).IsLike(string.Format("%{0}%", filter["Universal"]))
.List();
}
}
}