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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:37:59+00:00 2026-05-29T06:37:59+00:00

I have a doubt with enums if I defined a enums that inherited from

  • 0

I have a doubt with enums if I defined a enums that inherited from short like this:

public enum ProyectoEstatus : short
{
    EstatusPorDefecto = 26,
    AprobadoUnidadNegocio = 6,
    CanceladoAreaComercial = 18
}

why am i unble to do this??

Nullable<short> aux = ProyectoEstatus.CanceladoAreaComercial as ProyectoEstatus;

If my type of my variable called aux is Nullable

  • 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-29T06:38:00+00:00Added an answer on May 29, 2026 at 6:38 am

    First, the enum type itself is not nullable, so the as operator will not work on it.

    Secondly, the enum type is not actually a short. It is a short-backed enum type, but it will need to be explicitly cast into a short before it can undergo the implicit cast from short to Nullable<short>:

        Nullable<short> aux = (short)ProyectoEstatus.CanceladoAreaComercial 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is it possible to execute same function concurrently from thread. I have doubt that
I have no doubt at all that my own idiocy is responsible for this.
I have doubt about this two pattern, like MVC and PAC, which is more
I doubt this is possible but what I would like to do is have
I have no doubt this has been asked and answered here a dozen times,
I have a doubt with the syntax in the Twitter Bootstrap's JS files. This
I'm new in sql. I have doubt. Let's say that I have two tables.
doing some exercise from a book I've come across a doubt. I've defined some
I am wondering how you would approach this problem I have two Taxrates that
I have doubt about data structure transformation from one form of array to another.

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.