예제 #1
0
        public async void SetTruyenLastReadChapter(Wrapper.SiteTruyen site, string url, int lastReadChapter, int lastPageRead)
        {
            var value =
                await
                _connection.Table <TruyenSqlReadData>()
                .Where(o => o.Site == site && o.TruyenUrl == url)
                .FirstOrDefaultAsync();

            if (value != null)
            {
                value.LastChapterRead = lastReadChapter;
                value.LastPageRead    = lastPageRead;
                await _connection.UpdateAsync(value);
            }
            else
            {
                await _connection.InsertAsync(new TruyenSqlReadData()
                {
                    LastChapterRead = lastReadChapter,
                    Site            = site,
                    TruyenUrl       = url,
                    LastPageRead    = lastPageRead
                });
            }
        }
예제 #2
0
 public async Task <TruyenSqlReadData> GetTruyenStorageData(Wrapper.SiteTruyen site, string truyenUrl)
 {
     return(await
            _connection.Table <TruyenSqlReadData>()
            .Where(o => o.Site == site && o.TruyenUrl == truyenUrl)
            .FirstOrDefaultAsync());
 }