Esempio n. 1
0
        /// <summary>
        /// FROM ITEM DATA TO FORM DATA.
        /// </summary>
        /// <param name="itemData">the itemData to convert</param>
        /// <returns>the formdata result</returns>
        public static UpdateCountryFormData ToUpdateFormData(this CountryItemData itemData)
        {
            if (itemData == null)
            {
                return(new UpdateCountryFormData());
            }

            UpdateCountryFormData formData = new UpdateCountryFormData
            {
                CountryShortName = itemData.CountryShortName,
                CountryCode      = itemData.CountryCode,
                CountryId        = itemData.CountryId
            };

            return(formData);
        }
Esempio n. 2
0
        /// <summary>
        /// FROM FROMDATA TO ITEMDATA.
        /// </summary>
        /// <param name="formData">the formdata to convert</param>
        /// <returns>the item data.</returns>
        public static CountryItemData ToItemData(this UpdateCountryFormData formData)
        {
            if (formData == null)
            {
                return(new CountryItemData());
            }

            CountryItemData itemData = new CountryItemData
            {
                CountryImage     = formData.CountryImage?.FileName,
                CountryShortName = formData.CountryShortName,
                CountryCode      = formData.CountryCode,
                CountryId        = formData.CountryId
            };

            return(itemData);
        }