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 8425899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:24:06+00:00 2026-06-10T04:24:06+00:00

I have a problem which i’ve been googling but can’t find the answer to.

  • 0

I have a problem which i’ve been googling but can’t find the answer to.

Say if you have a class called Account which inherits from a class called AccountInquiry.

If you have an instance of AccountInquiry, can you convert this into an instance of Account without effectively copying it. If not what is the best way to manage this.

Basically a bit of background, when someone fills in a basic Name/Email form on our website is creates an account inquiry, once they’ve done this they are presented with a 2nd form. If this 2nd form gets fills in the account inquiry is converted into an account.

Many thanks

Sam

  • 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-10T04:24:08+00:00Added an answer on June 10, 2026 at 4:24 am

    It doesn’t sound like an Account really is an AccountInquiry. It sounds much more like these should be two entirely separate classes, even if they have some of the same properties.

    Be careful before you use inheritance – consider whether it’s really appropriate or not.

    In this case your AccountInquiry sounds like it’s effectively search criteria for a real Account – so you should probably have some service class which is able to perform the query, with a method something like:

    List<Account> FindAccounts(AccountInquiry inquiry)
    

    Or possibly just a return type of Account if only a single account should be matched. There’s no “conversion” going on here – you’d just be using the properties of one object to find another.

    (I suspect it should really be enquiry rather than inquiry by the way, but that’s an aside.)

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

Sidebar

Related Questions

I have a problem which seems simple, but I can't find an elegant solution
I have a problem which I cant seem to find answer to through searches
I have a problem which i can't seem to find the solution to. I
Once again I have a problem which I can't find the solution to. A
I have a problem which I can't find a solution. I have a Parent
I have this problem which i find a bit difficult to explain but I
I have a problem which I can't find a solution to. I have an
I have a small problem which i can't seem to figure out. I tried
I have another weird problem which I have not been able to solve in
I have a small problem which i can't seem to solve myself. Look at

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.