public override IList <RegionType> GetAllRegionTypesBelow(RegionType regionType) { using (var transaction = new TransactionScope(_configuration)) { var store = new RegionTypeDataStore(transaction); return(store.FindAllBelow(regionType)); } }
public override bool RegionTypeExists(RegionType regionType) { using (var transaction = new TransactionScope(_configuration)) { var rtDs = new RegionTypeDataStore(transaction); RegionType rt = rtDs.FindByName(regionType.Name); if (rt != null) { return(true); } } return(false); }
public override void CreateRegionType(RegionType regionType) { if (string.IsNullOrEmpty(regionType.Name)) { throw new ProviderException("Region Type name cannot be empty or null."); } if (regionType.Name.IndexOf(',') > 0) { throw new ArgumentException("Region Type names cannot contain commas."); } using (var transaction = new TransactionScope(_configuration)) { var rtDs = new RegionTypeDataStore(transaction); rtDs.Insert(regionType); transaction.Commit(); } }