Skip to content

Commit

Permalink
[#227] [add] controller version
Browse files Browse the repository at this point in the history
  • Loading branch information
i4004 committed Jan 21, 2024
1 parent 1480657 commit 1fe3fbc
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class Controller1Executor1(IController1Factory controllerFactory) : IVers
/// <summary>
/// Gets the controller version
/// </summary>
public short Version => 1;
public ControllerVersion Version => ControllerVersion.V1;

/// <summary>
/// Creates and executes the specified controller.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class Controller2Executor(IController2Factory controllerFactory) : IVersi
/// <summary>
/// Gets the controller version
/// </summary>
public short Version => 1;
public ControllerVersion Version => ControllerVersion.V2;

/// <summary>
/// Creates and executes the specified controller.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ namespace Simplify.Web.Core.Controllers.Execution;
public interface IVersionedControllerExecutor
{
/// <summary>
/// Gets the controller version
/// Gets the supported controller version
/// </summary>
public short Version { get; }
public ControllerVersion Version { get; }

/// <summary>
/// Creates and executes the specified controller.
Expand Down
16 changes: 16 additions & 0 deletions src/Simplify.Web/Meta/ControllerVersion.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace Simplify.Web.Meta;

/// <summary>
/// Provides controller version
/// </summary>
public enum ControllerVersion
{
/// <summary>
/// The version 1
/// </summary>
V1,
/// <summary>
/// The version 2
/// </summary>
V2
}
5 changes: 5 additions & 0 deletions src/Simplify.Web/Meta/IControllerMetaData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ public interface IControllerMetaData
/// </value>
Type ControllerType { get; }

/// <summary>
/// Gets the controller version
/// </summary>
public ControllerVersion Version { get; }

/// <summary>
/// Gets the controller execute parameters.
/// </summary>
Expand Down

0 comments on commit 1fe3fbc

Please sign in to comment.