public Classifier Create(string name, string description, Classifier parent)
{
Contract.Requires(!string.IsNullOrWhiteSpace(name));
Contract.Ensures(Contract.Result<Classifier>() != null && Contract.Result<Classifier>().Id >= 0);
Classifier u = new Classifier()
{
Name = name,
Description = description,
Parent = parent, // if parent is null, current node will be a root
};
using (IUnitOfWork uow = this.GetUnitOfWork())
{
IRepository<Classifier> repo = uow.GetRepository < Classifier>();
repo.Put(u);
uow.Commit();
}
return (u);
}