Skip to content

Commit

Permalink
Move Props to a different namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
kapi2289 committed Jan 6, 2025
1 parent e5d3c25 commit 06531d3
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions InertiaCore/Inertia.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Runtime.CompilerServices;
using InertiaCore.Props;
using InertiaCore.Utils;
using Microsoft.AspNetCore.Html;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace InertiaCore.Utils;
namespace InertiaCore.Props;

public class AlwaysProp
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace InertiaCore.Utils;
namespace InertiaCore.Props;

public class LazyProp
{
Expand Down
3 changes: 2 additions & 1 deletion InertiaCore/Response.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Text.Json.Serialization;
using InertiaCore.Extensions;
using InertiaCore.Models;
using InertiaCore.Props;
using InertiaCore.Utils;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ModelBinding;
Expand Down Expand Up @@ -155,7 +156,7 @@ public Response WithViewData(IDictionary<string, object> viewData)
{
var alwaysProps = _props.GetType().GetProperties()
.Where(o => o.PropertyType == typeof(AlwaysProp))
.ToDictionary(o => o.Name.ToCamelCase(), o => o.GetValue(_props)); ;
.ToDictionary(o => o.Name.ToCamelCase(), o => o.GetValue(_props));

return props
.Where(kv => kv.Value is not AlwaysProp)
Expand Down
2 changes: 1 addition & 1 deletion InertiaCore/ResponseFactory.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Net;
using System.Text.Json;
using System.Text.Json.Serialization;
using InertiaCore.Extensions;
using InertiaCore.Models;
using InertiaCore.Props;
using InertiaCore.Ssr;
using InertiaCore.Utils;
using Microsoft.AspNetCore.Html;
Expand Down

0 comments on commit 06531d3

Please sign in to comment.