public void Update(T entity) { try { _fileContext.ReplaceItem(entity, entity.Id); } catch (FileContextException e) { if (e.Code == FileContextExceptionCode.ItemNotFound) { throw new EntityNotFoundException(); } throw; } }