Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        public async Task <bool> Delete(BrandInfoDTO obj)
        {
            await ServiceProvider.GetService <IBrandManager>().RemoveAsync(obj);

            return(true);
        }