示例#1
0
        public virtual ApiCountryServerResponseModel MapServerRequestToResponse(
            int id,
            ApiCountryServerRequestModel request)
        {
            var response = new ApiCountryServerResponseModel();

            response.SetProperties(id,
                                   request.Name);
            return(response);
        }
示例#2
0
        public virtual ApiCountryServerResponseModel MapEntityToModel(
            Country item)
        {
            var model = new ApiCountryServerResponseModel();

            model.SetProperties(item.Id,
                                item.Name);

            return(model);
        }
示例#3
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);
        }
        public virtual ApiDestinationServerResponseModel MapEntityToModel(
            Destination item)
        {
            var model = new ApiDestinationServerResponseModel();

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

                model.SetCountryIdNavigation(countryIdModel);
            }

            return(model);
        }