Skip to content

Commit

Permalink
Migrate CreateObject to Manage
Browse files Browse the repository at this point in the history
  • Loading branch information
sushihangover committed Dec 14, 2016
1 parent 3b15ef6 commit 9346414
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 9346414

Please sign in to comment.