mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Fix patch for direct values
This commit is contained in:
parent
a374e23821
commit
08d9b9d950
@ -24,7 +24,7 @@ using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace Kyoo.Models;
|
||||
|
||||
public class Patch<T> : Dictionary<string, JObject>
|
||||
public class Patch<T> : Dictionary<string, JToken>
|
||||
where T : class, IResource
|
||||
{
|
||||
public Guid? Id => this.GetValueOrDefault(nameof(IResource.Id))?.ToObject<Guid>();
|
||||
@ -33,7 +33,7 @@ public class Patch<T> : Dictionary<string, JObject>
|
||||
|
||||
public T Apply(T current)
|
||||
{
|
||||
foreach ((string property, JObject value) in this)
|
||||
foreach ((string property, JToken value) in this)
|
||||
{
|
||||
PropertyInfo prop = typeof(T).GetProperty(
|
||||
property,
|
||||
|
Loading…
x
Reference in New Issue
Block a user