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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:18:18+00:00 2026-05-15T19:18:18+00:00

There is a public interface in the project with a value as follows: Name3D

  • 0

There is a public interface in the project with a value as follows:

Name3D MyName3D { get; set; }

Now in another location I am using a public sealed class, I added the namespace / using System.Interfacename. Now I want to set it like follows:

private readonly Interfacename m_MyName3D ;
private const string 3DName = ##;

How would i go aobut setting it up so ## is the value of MyName3D. Again I haven’t done anything like this before. Just wanted to give it a try?

Would be really appreciated if I could get some detail onto how it works.

Update One

Do you mean this?

using Interfacename;

public sealed class InfoController : AsyncController
{
    private readonly Interfacename m_MyName3D ;
    private const string 3DName = ##;
  • 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-15T19:18:18+00:00Added an answer on May 15, 2026 at 7:18 pm

    You can not assign anything to a const member at runtime. You can however make 3DName a readonly property and relay the get accessor to the interface:

    private string 3DName { get { return m_MyName3D.MyName3D; } }
    

    But maybe I did not get what you are trying to do, if so please describe it more clearly.

    edit: you are using two types for 3DName, Name3D and string. If Name3D has no conversion operators you need to use it throughout the property.

    private Name3D 3DName { get { return m_MyName3D.MyName3D; } }
    

    If you really need to return a string the you need to write a string conversion operator for Name3D:

    struct/class Name3D
    {
      public static implicit operator string(Name3D name)
      {
          return name.whatever; // this needs to be the data holding member(s) of Name3D
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a strange situation: in a .NET CF project there is a class
I have this structure: An interface IProjectService and this is implemented by ProjectServiceImpl. Now
There must be something fundamental about interfaces/generics I have not yet learned. I hope
here i am again in my self learning hibernate and personal experiment project to
I am implementing a project with Selenium 2, which currently doesn't support confirm dialog
I am using .NET 4, NUnit and Rhino mocks. I want to unit test
I have a project with many calculations involving a lot of real world units
I'm currently doing my third year programming project and its a folio tracker. :/
I'm currently working on saving larger object structures which contain all the data needed
I've been studying code of some different libraries, and notice that some will provide

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.