diff --git a/src/NJsonApiCore.Web.MVCCore.HelloWorld/Models/Person.cs b/src/NJsonApiCore.Web.MVCCore.HelloWorld/Models/Person.cs index 7643577..a089346 100644 --- a/src/NJsonApiCore.Web.MVCCore.HelloWorld/Models/Person.cs +++ b/src/NJsonApiCore.Web.MVCCore.HelloWorld/Models/Person.cs @@ -2,6 +2,10 @@ { public class Person { + public Person() + { + } + public Person(string firstname, string lastname, string twitter) { Id = StaticPersistentStore.GetNextId(); diff --git a/src/NJsonApiCore/ResourceMapping.cs b/src/NJsonApiCore/ResourceMapping.cs index 1c84d16..c1025d5 100644 --- a/src/NJsonApiCore/ResourceMapping.cs +++ b/src/NJsonApiCore/ResourceMapping.cs @@ -78,8 +78,14 @@ public Dictionary GetAttributes(object objectGraph) // TODO ROLA - type handling must be better in here public Dictionary GetValuesFromAttributes(Dictionary attributes) { + var values = new Dictionary(); + if (attributes == null) + { + return values; + } + foreach (var propertySetter in PropertySettersExpressions) { object value;