public async Task RemoveAsync(BrandInfoDTO obj, CancellationToken token = default(CancellationToken)) { Brand old = await(serviceProvider.GetService <IBrandRepository>() .LoadWith(p => p.Image) .FindByIDAsync(obj.ID)); await serviceProvider.GetService <IBrandRepository>().RemoveAsync(Mapper.Map <Brand>(obj), token); await imageManager.RemoveAsync(old.Image); }
public async Task <bool> Delete(BrandInfoDTO obj) { await ServiceProvider.GetService <IBrandManager>().RemoveAsync(obj); return(true); }