예제 #1
0
        public JsonPatchDocument <ApiLocationRequestModel> CreatePatch(ApiLocationRequestModel model)
        {
            var patch = new JsonPatchDocument <ApiLocationRequestModel>();

            patch.Replace(x => x.GpsLat, model.GpsLat);
            patch.Replace(x => x.GpsLong, model.GpsLong);
            patch.Replace(x => x.LocationName, model.LocationName);
            return(patch);
        }
예제 #2
0
        public virtual ApiLocationRequestModel MapResponseToRequest(
            ApiLocationResponseModel response)
        {
            var request = new ApiLocationRequestModel();

            request.SetProperties(
                response.GpsLat,
                response.GpsLong,
                response.LocationName);
            return(request);
        }
예제 #3
0
        public virtual ApiLocationResponseModel MapRequestToResponse(
            int locationId,
            ApiLocationRequestModel request)
        {
            var response = new ApiLocationResponseModel();

            response.SetProperties(locationId,
                                   request.GpsLat,
                                   request.GpsLong,
                                   request.LocationName);
            return(response);
        }