public IBORegion BORegion(IRegionRepository repo) { BORegion boRegion = (BORegion)BORegion(); boRegion.Repository = repo; return(boRegion); }
public async Task <IHttpActionResult> DeleteRegion(Int32 id) { var result = Task.Factory.StartNew(() => { IUnitOfWork uow = new UnitOfWorkImp(new IRepositoryConnection[] { RegionRepository }); var bo = new BORegion(); bo.Repository = RegionRepository; bo.Init(id); uow.Delete(bo); string err; if (!uow.Commit(out err)) { var resp = new HttpResponseMessage(HttpStatusCode.BadRequest) { Content = new StringContent(err) }; throw new HttpResponseException(resp); } return(true); }); await result; if (!result.Result) { return(NotFound()); } return(Ok(result.Result)); }
public IBORegion BORegion() { var boRegion = new BORegion() { RegionID = this.RegionID, RegionDescription = this.RegionDescription }; return(boRegion); }