コード例 #1
0
        public async Task <bool> UpdateAutomatic()
        {
            try
            {
                var resultForUpdate = await _geralPersist.GetInfo();

                resultForUpdate.UpdatedAt = DateTime.Now;
                var countBiblias = await _geralPersist.GetAll();

                resultForUpdate.RegistersCount = countBiblias.Count;
                FileInfo fileInfo = new FileInfo(Directory.GetCurrentDirectory() + "\\PocketNewTestament.db");
                resultForUpdate.DatabaseSize = fileInfo.Length.ToString();
                _geralPersist.Update <Info>(resultForUpdate);
                if (await _geralPersist.SaveChangesAsync())
                {
                    return(true);
                }
                return(false);
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
コード例 #2
0
 public async Task <List <Biblia> > GetAll()
 {
     return(await _geralPersist.GetAll());
 }