private static void MapGoal(Goal item, Goal_r instance)
 {
     instance.Id                = item.Id.ToString();
     instance.Image             = item.Image;
     instance.Amount            = (double)item.Amount;
     instance.Start             = new DateTimeOffset(item.Start);
     instance.End               = new DateTimeOffset(item.End);
     instance.Name              = item.Name;
     instance.ProgressPerMinute = (double)item.ProgressPerMinute;
 }
        public void Add(Goal item)
        {
            var realm = GetRealm();

            realm.Write(() =>
            {
                var instance = new Goal_r();
                MapGoal(item, instance);
                realm.Add(instance);
            });
        }
 private static Goal MapFromRealm(Goal_r instance)
 {
     return(new Goal
     {
         Id = new Guid(instance.Id),
         Name = instance.Name,
         Image = instance.Image,
         Amount = (decimal)instance.Amount,
         Start = instance.Start.DateTime,
         End = instance.End.DateTime,
         ProgressPerMinute = (decimal)instance.ProgressPerMinute
     });
 }