Пример #1
0
        public virtual ApiCountryRequirementServerResponseModel MapServerRequestToResponse(
            int id,
            ApiCountryRequirementServerRequestModel request)
        {
            var response = new ApiCountryRequirementServerResponseModel();

            response.SetProperties(id,
                                   request.CountryId,
                                   request.Details);
            return(response);
        }
Пример #2
0
        public virtual ApiCountryRequirementServerResponseModel MapEntityToModel(
            CountryRequirement item)
        {
            var model = new ApiCountryRequirementServerResponseModel();

            model.SetProperties(item.Id,
                                item.CountryId,
                                item.Details);
            if (item.CountryIdNavigation != null)
            {
                var countryIdModel = new ApiCountryServerResponseModel();
                countryIdModel.SetProperties(
                    item.CountryIdNavigation.Id,
                    item.CountryIdNavigation.Name);

                model.SetCountryIdNavigation(countryIdModel);
            }

            return(model);
        }