public Category GetByName(string name)
{
Category category = Session.CreateCriteria(typeof (Category))
.Add(Expression.Eq("Name", name))
.UniqueResult<Category>();
return category;
}
Or is it so clear that it doesn't need testing?