Exemplo n.º 1
0
        async void  LoadingEmpresaInicioViewModel()
        {
            var connection = await apiServicio.CheckConnection();

            if (!connection.IsSuccess)
            {
                await dialogoServices.ShowMensaje("Error", connection.Message);

                return;
            }
            var mainViewModel = MainViewModel.Getinstancia();
            var Responce      = await apiServicio.GetList <CategoryMap>("http://mecanicappapi.azurewebsites.net", "/api", "/Categories",
                                                                        mainViewModel.Token.Token_type, mainViewModel.Token.Access_token);

            if (!Responce.IsSuccess)
            {
                await dialogoServices.ShowMensaje("Error", connection.Message);

                return;
            }
            var categories = (List <CategoryMap>)Responce.Result;

            CategoryMaps = new ObservableCollection <CategoryMap>(categories.OrderBy(c => c.Descripcion));
        }