Skip to content

Commit

Permalink
feat(mvc): make view methods virtual
Browse files Browse the repository at this point in the history
The View and PartialView methods in RzController and RzControllerWithViews classes have been made virtual. This allows subclasses to override these methods if needed, providing more flexibility for customization. The version of the project has also been updated to 2.0.8 from 2.0.7 to reflect these changes.
  • Loading branch information
tanczosm committed Jul 19, 2024
1 parent 75cf97a commit fa4d836
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/Rizzy/Framework/Mvc/RzController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ public class RzController : ControllerBase, IRizzyService, IActionFilter, IAsync
public string CurrentActionUrl => RizzyService.CurrentActionUrl;

/// <inheritdoc/>
public IResult View<TComponent>(object? data = null) where TComponent : IComponent
public virtual IResult View<TComponent>(object? data = null) where TComponent : IComponent
=> RizzyService.View<TComponent>(data);

/// <inheritdoc/>
public IResult View<TComponent>(Dictionary<string, object?> data) where TComponent : IComponent
public virtual IResult View<TComponent>(Dictionary<string, object?> data) where TComponent : IComponent
=> RizzyService.View<TComponent>(data);

/// <inheritdoc/>
public IResult PartialView<TComponent>(object? data = null) where TComponent : IComponent
public virtual IResult PartialView<TComponent>(object? data = null) where TComponent : IComponent
=> RizzyService.PartialView<TComponent>(data);

/// <inheritdoc/>
public IResult PartialView<TComponent>(Dictionary<string, object?> data) where TComponent : IComponent
public virtual IResult PartialView<TComponent>(Dictionary<string, object?> data) where TComponent : IComponent
=> RizzyService.PartialView<TComponent>(data);

/// <summary>
Expand Down
8 changes: 4 additions & 4 deletions src/Rizzy/Framework/Mvc/RzControllerWithViews.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ public class RzControllerWithViews : Controller, IRizzyService
public string CurrentActionUrl => RizzyService.CurrentActionUrl;

/// <inheritdoc/>
public IResult View<TComponent>(object? data = null) where TComponent : IComponent
public virtual IResult View<TComponent>(object? data = null) where TComponent : IComponent
=> RizzyService.View<TComponent>(data);

/// <inheritdoc/>
public IResult View<TComponent>(Dictionary<string, object?> data) where TComponent : IComponent
public virtual IResult View<TComponent>(Dictionary<string, object?> data) where TComponent : IComponent
=> RizzyService.View<TComponent>(data);

/// <inheritdoc/>
public IResult PartialView<TComponent>(object? data = null) where TComponent : IComponent
public virtual IResult PartialView<TComponent>(object? data = null) where TComponent : IComponent
=> RizzyService.PartialView<TComponent>(data);

/// <inheritdoc/>
public IResult PartialView<TComponent>(Dictionary<string, object?> data) where TComponent : IComponent
public virtual IResult PartialView<TComponent>(Dictionary<string, object?> data) where TComponent : IComponent
=> RizzyService.PartialView<TComponent>(data);

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Rizzy/Rizzy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<Version>2.0.7</Version>
<Version>2.0.8</Version>
<EnablePackageValidation>true</EnablePackageValidation>
<GenerateCompatibilitySuppressionFile>true</GenerateCompatibilitySuppressionFile>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
Expand Down

0 comments on commit fa4d836

Please sign in to comment.