/// <summary> /// Deletes the given model. /// </summary> /// <param name="model">The model</param> public async Task DeleteAsync(ContentType model) { // Call hooks & delete App.Hooks.OnBeforeDelete(model); await _repo.Delete(model.Id).ConfigureAwait(false); App.Hooks.OnAfterDelete(model); // Clear cache _cache?.Remove(CacheKey); }
public void Delete(Guid id) { using (IUnitOfWork uow = new UnitOfWork(RepositoryType.MSSQL)) { IContentTypeRepository repo = IoC.Container.Resolve <IContentTypeRepository>(uow); repo.Delete(id); uow.Commit(); } }
public void Delete(Guid id) { using (IUnitOfWork uow = new UnitOfWork(new AppDbContext(IOMode.Write))) { IContentTypeRepository repo = IoC.Container.Resolve <IContentTypeRepository>(uow); repo.Delete(id.ToString()); uow.Commit(); } }