Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8903459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:52:32+00:00 2026-06-15T01:52:32+00:00

We recently introduced a completely new data model which is different from our current

  • 0

We recently introduced a completely new data model which is different from our current model from the logical structure point of view. We also changed the language of the model from German to English, because we want to open the models structure as XML to our customer.

In order to be able to convert the model we implemented a explicit conversion which basically matches all properties from the different classes of the new model into our old model.

Like this:

private OldModel Convert(NewModel src)
{
  var dst = new OldModel();
  dst.Prop1 = src.SomeOtherProp
  dst.Prop2 = Convert(src.ComplexProp);
  //....
  return dst;
}

Now we want to make sure, all of the properties of the new model are written into the old model for coverage and testing purposes. We also want to make sure we didn’t forget any property and also guarantee that for future model extensions, we don’t forget a property.

My idea would be to parse the codefile, extract all properties which are read from the new model, run over the new model with reflection compare them with the actual properties within it.

This solution feels not like a good one 🙂 Any suggestions?

I appreciate any help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T01:52:33+00:00Added an answer on June 15, 2026 at 1:52 am

    We finally decided to parse the codefile with regular expressions like this:

    @"private static [a-zA-Z0-9.]+[ ]+Convert[(][^)]*[)]\s*[{](?<body>[^{}]*(((?<Open>[{])[^{}]*)+((?<Close-Open>[}])[^{}]*)+)*(?(Open)(?!)))[}]";
    

    It will match methods like this private static Namespace.ClassName Convert(Namespace.ClassName input) and will extract the methods body.
    Since the converter methods follow a simple structural pattern, it was easy to extract the information I needed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recently been introduced to the new Access 2007 feature which is multivalued
I'm new to JavaScript following the courses from codecademy.com. Recently they introduced bracket notation
We have recently introduced version control in Subversion in our development cycle, and a
Recently I was introduced to this OCaml code which in Haskell can be written
Recently I have been exploring using the fancy new dynamic keyword introduced in C#
I recently introduced HTML into some RSS feeds that I publish (which up to
We recently introduced PostSharp into our code base and the compile time of our
I wrote one sample function to understand behavior of std::chrono::duration which recently introduced as
Recently a couple of WCF services have been introduced to our company's API. There
I have a project with which I have just recently introduced RequireJS. Before RequireJS,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.