public bool DeleteDataAttribute(DataAttribute entity)
{
Contract.Requires(entity != null);
Contract.Requires(entity.Id >= 0);
using (IUnitOfWork uow = this.GetUnitOfWork())
{
IRepository<DataAttribute> repo = uow.GetRepository<DataAttribute>();
IRepository<ExtendedProperty> exRepo = uow.GetRepository<ExtendedProperty>();
IRepository<Parameter> vpuRepo = uow.GetRepository<Parameter>();
entity = repo.Reload(entity);
repo.LoadIfNot(entity.ExtendedProperties);
//repo.LoadIfNot(entity.ParameterUsages);
exRepo.Delete(entity.ExtendedProperties);
entity.ExtendedProperties.Clear();
//vpuRepo.Delete(entity.ParameterUsages);
//entity.ParameterUsages.Clear();
repo.Delete(entity);
uow.Commit();
}
// if any problem was detected during the commit, an exception will be thrown!
return (true);
}