Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore IUpdateModel and BuildPartDisplayContext in console_log #11286

Merged
merged 3 commits into from
May 19, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public class BagPartEditViewModel
[BindNever]
public BagPart BagPart { get; set; }

[System.Text.Json.Serialization.JsonIgnore]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't there a common attribute that doesn't require referencing these libraries?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added as - I guess NewtosoftJson's JsonIgnore wont work for System.Text.Json

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[IgnoreDataMember], or [NonSerialized] might work for both libraries

Copy link
Contributor Author

@ns8482e ns8482e Mar 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sebastienros NonSerialized is not allowed on properties
However IgnoreDataMember is working - Updated the PR

[Newtonsoft.Json.JsonIgnore]
[BindNever]
public IUpdateModel Updater { get; set; }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc.ModelBinding;
using OrchardCore.ContentManagement;
using OrchardCore.ContentManagement.Display.Models;
using OrchardCore.Flows.Models;
Expand All @@ -9,7 +10,12 @@ public class BagPartViewModel
{
public BagPart BagPart { get; set; }
public IEnumerable<ContentItem> ContentItems => BagPart.ContentItems;

[System.Text.Json.Serialization.JsonIgnore]
[Newtonsoft.Json.JsonIgnore]
[BindNever]
public BuildPartDisplayContext BuildPartDisplayContext { get; set; }

public BagPartSettings Settings { get; set; }
public string DisplayType => Settings?.DisplayType;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public class FlowPartEditViewModel
[BindNever]
public FlowPart FlowPart { get; set; }

[System.Text.Json.Serialization.JsonIgnore]
[Newtonsoft.Json.JsonIgnore]
[BindNever]
public IUpdateModel Updater { get; set; }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
using OrchardCore.ContentManagement.Display.Models;
using Microsoft.AspNetCore.Mvc.ModelBinding;
using OrchardCore.ContentManagement.Display.Models;
using OrchardCore.Flows.Models;

namespace OrchardCore.Flows.ViewModels
{
public class FlowPartViewModel
{
public FlowPart FlowPart { get; set; }

[System.Text.Json.Serialization.JsonIgnore]
[Newtonsoft.Json.JsonIgnore]
[BindNever]
public BuildPartDisplayContext BuildPartDisplayContext { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public class WidgetsListPartEditViewModel

public WidgetsListPart WidgetsListPart { get; set; }

[System.Text.Json.Serialization.JsonIgnore]
[Newtonsoft.Json.JsonIgnore]
[BindNever]
public IUpdateModel Updater { get; set; }
}
Expand Down