public MessageResponseDTO Delete(string uuid) { var toDelete = FindOneByUUID(uuid); if (toDelete == null) { throw new EntityNotFoundException($"Message with uuid {uuid} doesn't exist!", GeneralConsts.MICROSERVICE_NAME); } this._queryExecutor.Execute(DatabaseConsts.USER_SCHEMA, _sqlCommands.DELETE_RECIPIENT_BY_MESSAGE(uuid), this._modelMapper.MapToMessage); this._queryExecutor.Execute(DatabaseConsts.USER_SCHEMA, _sqlCommands.DELETE_FILE_MESSAGE_BY_MESSAGE(uuid), this._modelMapper.MapToMessage); this._queryExecutor.Execute(DatabaseConsts.USER_SCHEMA, _sqlCommands.DELETE_MESSAGE(uuid), this._modelMapper.MapToMessage); return(this._autoMapper.Map <MessageResponseDTO>(toDelete)); }