public ICommandResult Handle(GetObjectTypeCommand command) { ICommandResult result = new GetObjectTypeCommandResult(); _loggingService.Log(this.GetType(), ELogType.Neutral, ELogLevel.Debug, new { command.ObjectType, command.RequestHost }, "ObjectTypeCommandHandler.Handle(Get)"); try { if (_objectTypeRepository.CheckExists(command.ObjectType)) { ObjectType objectType = _objectTypeRepository.Get(command.ObjectType); if (objectType != null) { result = new GetObjectTypeCommandResult(200, objectType.Name); } } else if (_objectTypeRepository.Valid) { result = new GetObjectTypeCommandResult(400, new Notification("Object Type", "Could not be found")); } } catch (Exception e) { _loggingService.Log(this.GetType(), ELogType.Neutral, ELogLevel.Error, new { command.ObjectType, command.RequestHost }, e); } return(result); }