mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-30 19:54:16 -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;
|
namespace Kyoo.Models;
|
||||||
|
|
||||||
public class Patch<T> : Dictionary<string, JObject>
|
public class Patch<T> : Dictionary<string, JToken>
|
||||||
where T : class, IResource
|
where T : class, IResource
|
||||||
{
|
{
|
||||||
public Guid? Id => this.GetValueOrDefault(nameof(IResource.Id))?.ToObject<Guid>();
|
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)
|
public T Apply(T current)
|
||||||
{
|
{
|
||||||
foreach ((string property, JObject value) in this)
|
foreach ((string property, JToken value) in this)
|
||||||
{
|
{
|
||||||
PropertyInfo prop = typeof(T).GetProperty(
|
PropertyInfo prop = typeof(T).GetProperty(
|
||||||
property,
|
property,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user