Example #1
0
 public async Task UpdateDailyExtra(ViewModel.DailyExtraModel item)
 {
     await DeleteAsync <Model.DailyExtraModel>(item.id).ContinueWith(async(results) =>
     {
         await InsertAsync(new Model.DailyExtraModel
         {
             Id             = item.id,
             comments       = item.comments,
             long_comments  = item.long_comments,
             popularity     = item.popularity,
             short_comments = item.short_comments
         });
     });
 }
Example #2
0
            public async Task <ViewModel.DailyExtraModel> QueryDailyExtra(int id)
            {
                var vExtra = new ViewModel.DailyExtraModel();

                var extra = await Table <Model.DailyExtraModel>().Where(d => d.Id == id).FirstOrDefaultAsync();

                if (extra != null)
                {
                    vExtra = new ViewModel.DailyExtraModel()
                    {
                        id             = extra.Id,
                        comments       = extra.comments,
                        long_comments  = extra.long_comments,
                        popularity     = extra.popularity,
                        short_comments = extra.short_comments
                    };
                }
                return(vExtra);
            }