public virtual ApiProvinceServerResponseModel MapServerRequestToResponse(
            int id,
            ApiProvinceServerRequestModel request)
        {
            var response = new ApiProvinceServerResponseModel();

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

            model.SetProperties(item.Id,
                                item.Address1,
                                item.Address2,
                                item.AdminId,
                                item.Email,
                                item.Facebook,
                                item.Name,
                                item.Phone,
                                item.ProvinceId,
                                item.Website);
            if (item.AdminIdNavigation != null)
            {
                var adminIdModel = new ApiAdminServerResponseModel();
                adminIdModel.SetProperties(
                    item.AdminIdNavigation.Id,
                    item.AdminIdNavigation.Email,
                    item.AdminIdNavigation.FirstName,
                    item.AdminIdNavigation.LastName,
                    item.AdminIdNavigation.Password,
                    item.AdminIdNavigation.Phone,
                    item.AdminIdNavigation.Username);

                model.SetAdminIdNavigation(adminIdModel);
            }

            if (item.ProvinceIdNavigation != null)
            {
                var provinceIdModel = new ApiProvinceServerResponseModel();
                provinceIdModel.SetProperties(
                    item.ProvinceIdNavigation.Id,
                    item.ProvinceIdNavigation.CountryId,
                    item.ProvinceIdNavigation.Name);

                model.SetProvinceIdNavigation(provinceIdModel);
            }

            return(model);
        }
Пример #3
0
        public virtual ApiProvinceServerResponseModel MapEntityToModel(
            Province item)
        {
            var model = new ApiProvinceServerResponseModel();

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

                model.SetCountryIdNavigation(countryIdModel);
            }

            return(model);
        }
Пример #4
0
        public virtual ApiCityServerResponseModel MapEntityToModel(
            City item)
        {
            var model = new ApiCityServerResponseModel();

            model.SetProperties(item.Id,
                                item.Name,
                                item.ProvinceId);
            if (item.ProvinceIdNavigation != null)
            {
                var provinceIdModel = new ApiProvinceServerResponseModel();
                provinceIdModel.SetProperties(
                    item.ProvinceIdNavigation.Id,
                    item.ProvinceIdNavigation.CountryId,
                    item.ProvinceIdNavigation.Name);

                model.SetProvinceIdNavigation(provinceIdModel);
            }

            return(model);
        }