WorkspaceGetCommand.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using BO.Console.Commands.Base;
  5. using Quadarax.Foundation.Core.QConsole;
  6. using Quadarax.Foundation.Core.QConsole.Attributes;
  7. using Quadarax.Foundation.Core.Value;
  8. namespace BO.Console.Commands.Workspace
  9. {
  10. [CommandDefinition]
  11. internal class WorkspaceGetCommand : AbstractGetCommand
  12. {
  13. #region *** Constants ***
  14. private const string CS_CMD_WRKSPGET_NAME = "workspace_get";
  15. private const string CS_CMD_WRKSPGET_DESCR = "Get single workspace by specification.";
  16. #endregion
  17. #region *** Properties ***
  18. public override string Name => CS_CMD_WRKSPGET_NAME;
  19. public override string Description => CS_CMD_WRKSPGET_DESCR;
  20. #endregion
  21. #region *** Constructor ***
  22. public WorkspaceGetCommand(Engine engine) : base(engine)
  23. {
  24. }
  25. #endregion
  26. #region *** EXECUTE ***
  27. protected override Result OnExecute()
  28. {
  29. var workspace = Client.GetWorkspaceAsync(IdentificationType, IdentificationValue).Result;
  30. WriteDtoToConsole(workspace);
  31. return new Result();
  32. }
  33. #endregion
  34. }
  35. }