Skip to content

Commit

Permalink
Merge pull request #10 from sushihangover/createobject
Browse files Browse the repository at this point in the history
Migrate CreateObject to Manage
  • Loading branch information
sushihangover authored Dec 14, 2016
2 parents 3b15ef6 + 9346414 commit 27b4ab0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/RealmJson.Extensions/Extension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,9 @@ static void CreateUpdateRecordsViaAutoMapper<T>(Realm realm, PropertyInfo pkProp
}
if (realmObject == null)
{
realmObject = realm.CreateObject(typeof(T).Name);
realmObject = (T)Activator.CreateInstance(typeof(T));
newMapper.Map<T, T>(jsonObject, realmObject);
realm.Manage(realmObject, true);
}
else
{
Expand Down

0 comments on commit 27b4ab0

Please sign in to comment.