Exemple #1
0
        public static async Task <_PaginaBase> RemoverPaginaAtual() => await Device.InvokeOnMainThreadAsync(async() =>
        {
            if (Navegacao != null)
            {
                var resultado = await Navegacao.PopAsync(true).ConfigureAwait(false);

                return(Miscelanea.Converter <Page, _PaginaBase>(resultado));
            }

            await Mensagem($"Não foi possível remover a página porque {nameof(Navegacao)} está nulo").ConfigureAwait(false);

            return(null);
        }).ConfigureAwait(false);
Exemple #2
0
        public async Task <Dictionary <Type, bool> > Inicializar()
        {
            Miscelanea.DefinirAtributosPai(typeof(_ModeloBase));

            var modelos = Miscelanea.PegarTodasClassesEmNamespace(typeof(_ModeloBase).Namespace).Where(x => x.Name != nameof(SQLiteConnection.ColumnInfo) && x.IsClass && !x.IsAbstract && Conexao.TableMappings.All(p => p.TableName.ToLower() != x.Name.ToLower())).ToArray();

            await Conexao.EnableLoadExtensionAsync(true).ConfigureAwait(false);

            await Conexao.EnableWriteAheadLoggingAsync().ConfigureAwait(false);

            var resultado = await Conexao.CreateTablesAsync(CreateFlags.AutoIncPK, modelos).ConfigureAwait(false);

            return(resultado.Results.ToDictionary(x => x.Key, x => x.Value == CreateTableResult.Created));
        }