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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T17:28:49+00:00 2026-06-03T17:28:49+00:00

i read the following great question: Attributes in C# and learned a lot about

  • 0

i read the following great question: Attributes in C# and learned a lot about attributes.

i am using a library that uses several attributes. example:

[State]
public class USStates
{
    [City]
    public void isNewYork() { }
    [Zip]
    public ZipCode GetZipCode() { }
}

i wanted to create my own attributes and perform additional work on my classes using existing attributes (State, City, Zip) which are from a 3rd party namespace. for example, i’m trying to achieve this:

using 3rdPartyNamespace;
using MyOwnSuperNamespace;

public class State : Attribute 
{ 
    // my own implementation/extension of State 
}

// create City, Zip attributes respectively

[State]
public class USStates
{
    [City]
    public void isNewYork() { }
    [Zip]
    public ZipCode GetZipCode() { }
}

i tried the above but keeping getting an ambiguous attribute error on all 3 attributes. ho can i tell the compiler to direct call to both attributes instead of using either one? i would like to keep the existing attributes and perform additional work without having to mark my classes with additional attributes that i have created.

is this possible?

  • 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-03T17:28:50+00:00Added an answer on June 3, 2026 at 5:28 pm

    ho can i tell the compiler to direct call to both attributes instead of using either one?

    If you want to apply both attributes, you need to specify both attributes. You’ll need to either fully-qualify the attribute names, or use using alias directives, e.g.

    using Mine = MyOwnSuperNamespace;
    using Theirs = 3rdPartyNamespace;
    
    [Mine.State]
    [Theirs.State]
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using following JavaScript/Ajax to read page content, This script works great but
First of all let me tell you that i have read the following questions
I need to write a simple program for work that does the following: read
I recently read the the following SO question. What's the best way to store
Please read Update1 first! This is SSIS specific question. I have the following tasks:
This is a generic C++ design question. I'm writing an application that uses a
From the little I have read, I understood that Hadoop is great for the
how do I read the following xml document? My code is : var vb
I recently read the following overflow post: Hidden Features of C# One of the
I've read the following post. My Code looks exactly the same, but does not

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.