private async void GetEntity() { if (this.FormSettings.RequestDetails.Filter == null) { throw new ArgumentException($"{nameof(this.FormSettings.RequestDetails.Filter)}: 883E834F-98A6-4DF7-9D07-F1BB0D6639E1"); } BaseResponse baseResponse = await BusyIndicatorHelpers.ExecuteRequestWithBusyIndicator ( () => this.httpService.GetEntity ( new GetEntityRequest { Filter = this.FormSettings.RequestDetails.Filter, SelectExpandDefinition = this.FormSettings.RequestDetails.SelectExpandDefinition, ModelType = this.FormSettings.RequestDetails.ModelType, DataType = this.FormSettings.RequestDetails.DataType } ) ); if (baseResponse.Success == false) { await App.Current.MainPage.DisplayAlert ( "Errors", string.Join(Environment.NewLine, baseResponse.ErrorMessages), "Ok" ); return; } GetEntityResponse getEntityResponse = (GetEntityResponse)baseResponse; this.entity = (TModel)getEntityResponse.Entity; this.originalEntityDictionary = this.entity.EntityToObjectDictionary ( mapper, this.FormSettings.FieldSettings ); this.propertiesUpdater.UpdateProperties ( FormLayout.Properties, getEntityResponse.Entity, this.FormSettings.FieldSettings ); }
private async void GetEntity() { if (this.FormSettings.RequestDetails.Filter == null) { throw new ArgumentException($"{nameof(this.FormSettings.RequestDetails.Filter)}: 51755FE3-099A-44EB-A59B-3ED312EDD8D1"); } BaseResponse baseResponse = await BusyIndicatorHelpers.ExecuteRequestWithBusyIndicator ( () => this.httpService.GetEntity ( new GetEntityRequest { Filter = this.FormSettings.RequestDetails.Filter, SelectExpandDefinition = this.FormSettings.RequestDetails.SelectExpandDefinition, ModelType = this.FormSettings.RequestDetails.ModelType, DataType = this.FormSettings.RequestDetails.DataType } ) ); if (baseResponse.Success == false) { await App.Current.MainPage.DisplayAlert ( "Errors", string.Join(Environment.NewLine, baseResponse.ErrorMessages), "Ok" ); return; } GetEntityResponse getEntityResponse = (GetEntityResponse)baseResponse; this.entity = (TModel)getEntityResponse.Entity; (EditCommand as Command).ChangeCanExecute(); this.propertiesUpdater.UpdateProperties ( FormLayout.Properties, getEntityResponse.Entity, this.FormSettings.FieldSettings ); }