public JsonPatchDocument <ApiAdminRequestModel> CreatePatch(ApiAdminRequestModel model) { var patch = new JsonPatchDocument <ApiAdminRequestModel>(); patch.Replace(x => x.Email, model.Email); patch.Replace(x => x.FirstName, model.FirstName); patch.Replace(x => x.LastName, model.LastName); patch.Replace(x => x.Password, model.Password); patch.Replace(x => x.Phone, model.Phone); patch.Replace(x => x.Username, model.Username); return(patch); }
public virtual ApiAdminRequestModel MapResponseToRequest( ApiAdminResponseModel response) { var request = new ApiAdminRequestModel(); request.SetProperties( response.Email, response.FirstName, response.LastName, response.Password, response.Phone, response.Username); return(request); }
public virtual ApiAdminResponseModel MapRequestToResponse( int id, ApiAdminRequestModel request) { var response = new ApiAdminResponseModel(); response.SetProperties(id, request.Email, request.FirstName, request.LastName, request.Password, request.Phone, request.Username); return(response); }