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

  • Home
  • SEARCH
  • 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 7604607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:57:18+00:00 2026-05-30T23:57:18+00:00

I have a simple data layer routine that performs a password update, the user

  • 0

I have a simple data layer routine that performs a password update, the user passes in the following:

  • Current Password, New Password, Confirm New Password.

In my data layer (proc) checks a couple things such as:

  1. Is the current password correct?
  2. Is the new password and confirm password correct?
  3. Has the new password been assigned in the past?

And so on…

Now I know I can simply create a class and returned a couple booleans:

public class UpdatePasswordResponse{

public bool CurrentPasswordCorrect {get;set;}
....(and so on)

}

But is there a way I can dynamically return that information to the biz layer in properties instead of creating a new class everytime (for every data layer routine)? I seem to remember thinking this was possible. I am pretty sure I read it somewhere but don’t remember the syntax, can someone help me?

  • 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-05-30T23:57:20+00:00Added an answer on May 30, 2026 at 11:57 pm

    You can do this in .NET 4 with the use of the dynamic keyword.

    The class you will want to return would be an ExpandoObject.

    Basically, follow this pattern:

    public object GetDynamicObject()
    {
        dynamic obj = new ExpandoObject();
        obj.DynamicProperty1 = "hello world";
        obj.DynamicProperty2 = 123;
        return obj;
    }
    
    
    // elsewhere in your code:
    
    dynamic myObj = GetDynamicObject();
    string hello = myObj.DynamicProperty1;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple object that get's geocoding data from the Google Maps API
If I have a simple table where the data is such that the rows
I have a WCF service that uses LINQ to SQL for its data layer.
I have a list of 10 data objects that I want to insert/update to
I'm starting a new project which in simple terms will have a UI layer
I have a simple data model of two tables, email and recipients, email can
I have only simple data types in method signature of service (such as int,
I have a simple WCF Data Services service and I want to expose a
I have simple SSIS package which reads data from flat file and insert into
I have simple SSIS package where I import data from flat file into SQL

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.