BExIS.Dlm.Services.Data.DatasetManager.DeleteDataView C# (CSharp) Method

DeleteDataView() public method

Detaches the data view from its dataset and deletes the view from the database.
public DeleteDataView ( DataView entity ) : bool
entity BExIS.Dlm.Entities.DataStructure.DataView
return bool
        public bool DeleteDataView(DataView entity)
        {
            Contract.Requires(entity != null);
            Contract.Requires(entity.Id >= 0);

            using (IUnitOfWork uow = this.GetUnitOfWork())
            {
                IRepository<DataView> repo = uow.GetRepository<DataView>();

                entity = repo.Reload(entity);
                repo.Delete(entity);
                uow.Commit();
            }
            // if any problem was detected during the commit, an exception will be thrown!
            return (true);
        }