/// <summary> /// From REQUESTDATA To FORMDATA /// </summary> /// <param name="authorRequestData"></param> /// <returns></returns> public static AreaTranslationFormData ToFormData(this AreaTranslationRequestData authorRequestData) { if (authorRequestData?.AreaTranslationDto == null) { return(new AreaTranslationFormData()); } return(new AreaTranslationFormData { TranslationId = authorRequestData.AreaTranslationDto.TranslationId, LanguageId = authorRequestData.AreaTranslationDto.LanguageId, AreaName = authorRequestData.AreaTranslationDto.AreaName, AreaId = authorRequestData.AreaTranslationDto.AreaId }); }
/// <summary> /// Get Area Translations /// </summary> /// <param name="areaId"></param> /// <returns></returns> private async Task <List <AreaTranslationItemData> > GetAreaTranslations(int areaId) { List <AreaTranslationItemData> translationsList = new List <AreaTranslationItemData>(); AreaTranslationRequestData findAreaTranslationRequest = new AreaTranslationRequestData() { AreaTranslationDto = new AreaTranslationItemData { AreaId = areaId }, FindAreaTranslationDto = FindAreaTranslationItemData.AreaId }; AreaTranslationResultData resultAreaTranslation = await WebApiClient.PostFormJsonAsync <AreaTranslationRequestData, AreaTranslationResultData>( Constant.WebApiControllerRessources, Constant.WebApiFindAreaTranslations, findAreaTranslationRequest); if (resultAreaTranslation != null && resultAreaTranslation.OperationSuccess && resultAreaTranslation.AreaTranslationDtoList != null) { translationsList.AddRange(resultAreaTranslation.AreaTranslationDtoList.Where(n => n.LanguageId == _lang) .ToList()); } return(translationsList); }