Exemple #1
0
        /*
         * protected override async Task DeleteFromServer()
         * {
         *  var client = WebApiClientFactory.CreateELMAH_ErrorApiClient();
         *  var item = new Elmah.DataSourceEntities.ELMAH_Error();
         *      item.CopyFrom<Elmah.EntityContracts.IELMAH_Error>(Item);
         *
         *  var result = await client.DeleteEntityAsync(item);
         *  this.StatusOfResult = result.BusinessLogicLayerResponseStatus;
         *  this.StatusMessageOfResult = result.GetStatusMessage();
         * }
         */

        protected override async Task <Elmah.ViewModelData.ELMAH_Error.ItemVM> GetFromServer(Elmah.EntityContracts.IELMAH_ErrorIdentifier identifier)
        {
            var client = WebApiClientFactory.CreateELMAH_ErrorApiClient();
            var result = await client.GetItemVMAsync(identifier.ErrorId);

            return(result);
        }
Exemple #2
0
        protected override async Task <Elmah.CommonBLLEntities.ELMAH_ErrorResponseMessageBuiltIn.Default> UpsertToServer()
        {
            var client = WebApiClientFactory.CreateELMAH_ErrorApiClient();
            var item   = new Elmah.DataSourceEntities.ELMAH_Error();

            item.CopyFrom <Elmah.EntityContracts.IELMAH_Error>(Item);

            var result = await client.UpsertEntityAsync(item);

            return(result);
        }
Exemple #3
0
        protected override async Task <Elmah.ViewModelData.ELMAH_Error.IndexVM> GetFromServer()
        {
            var vmData = new Elmah.ViewModelData.ELMAH_Error.IndexVM
            {
                Criteria                      = this.Criteria,
                QueryPagingSetting            = CachingOption == Framework.Xaml.CachingOptions.NoCaching ? this.QueryPagingSetting : new Framework.Queries.QueryPagingSetting(1, 10000),
                QueryOrderBySettingCollection = new Framework.Queries.QueryOrderBySettingCollection(QueryOrderBySettingCollection.Where(t => t.IsSelected)),
            };

            vmData.Criteria.CanQueryWhenNoQuery = true;

            /*
             * // Add extra QueryOrderBySetting, eg CategoryName -> Name of this class.
             * if (QueryOrderBySettingCollection.Any(t => t.IsSelected && t.PropertyName == nameof(Elmah.DataSourceEntities.ELMAH_Error.Default.??)))
             * {
             *  vmData.QueryOrderBySettingCollection.Add(new Framework.Queries.QueryOrderBySetting { PropertyName = nameof(Elmah.DataSourceEntities.ELMAH_Error.Default.??), Direction = QueryOrderBySettingCollection.First(t => t.IsSelected && t.PropertyName == nameof(Elmah.DataSourceEntities.ELMAH_Error.Default.??)).Direction } );
             * }
             */

            var client = WebApiClientFactory.CreateELMAH_ErrorApiClient();
            var result = await client.GetIndexVMAsync(vmData);

            return(result);
        }