Skip to content

Commit 943a7e3

Browse files
author
Harro van der Kroft
committed
fix: fixced isimmutable not working
1 parent 0416df7 commit 943a7e3

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/JsonApiDotNetCore/Models/AttrAttribute.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public AttrAttribute(string publicName = null, bool isImmutable = false, bool is
3232
IsImmutable = isImmutable;
3333
IsFilterable = isFilterable;
3434
IsSortable = isSortable;
35+
3536
}
3637

3738
/// <summary>

src/JsonApiDotNetCore/Serialization/JsonApiDeSerializer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,11 @@ private object SetEntityAttributes(
146146
{
147147
if (attributeValues.TryGetValue(attr.PublicAttributeName, out object newValue))
148148
{
149+
if (attr.IsImmutable)
150+
continue;
149151
var convertedValue = ConvertAttrValue(newValue, attr.PropertyInfo.PropertyType);
150152
attr.SetValue(entity, convertedValue);
151-
152-
if (attr.IsImmutable == false)
153-
_jsonApiContext.AttributesToUpdate[attr] = convertedValue;
153+
_jsonApiContext.AttributesToUpdate[attr] = convertedValue;
154154
}
155155
}
156156

0 commit comments

Comments
 (0)