You must Sign In to post a response.
  • Category: ASP.NET

    Overriding abstract property

    please read it full...


    i want to return multiple values by overriding the abstract ptoperty (testCode )...

    please check the code and let me know how to do please...


    my base class...

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    namespace AbstractProperties2
    {
    abstract class ParentClass
    {

    protected abstract testCode YardType { get; }
    public enum testCode
    {
    val1 = 1,
    val2 = 2,
    val3 = 3,
    val4 = 4,
    val5 = 5,
    val6 = 6,
    val7 = 7
    }

    }
    }

    ....

    my ChildClass

    .....

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    namespace AbstractProperties2
    {
    class ClildClass : ParentClass
    {
    protected override testCode YardType { get {
    return testCode.val2;// here i want to pass value like testCode.val2,testCode.val3
    }
    }

    static void Main(string[] args)
    {
    ClildClass c1 = new ClildClass();
    Console.WriteLine(c1.YardType);
    Console.Read();
    }
    }
    }


    thanks in advance
  • #477443
    If you want to return multiple values then you will have to change the return type to an array instead of just a single value. If my response does not answer your question then please rephrase your question, as it is not clear whether you want to return multiple values or one of the multiple enum values.
    Kind regards,
    ABitSmart
    DNS Web-master, DNS MVM
    My blog


  • This thread is locked for new responses. Please post your comments and questions as a separate thread.
    If required, refer to the URL of this page in your new post.