0

I am returning a list of values, and I would like to assign each one to an enum for better search. I have few fields - such as Desc, Value and so on.. I would like each of them to have an assigned enum value. So Desc would be 10, Value 20 and so on.

I am returning values like this

     var articleData = new List<Article>();
 foreach (var  textField in result.TextResult)
{
     var data = new Article
      {
          Desc = textField.Name + ":",
          Value = textField.Value,
          Type = ....
      };
           articleData.Add(data);
  }  
    
   public enum Type 
        {
            None = 0,
            Value = 10,
            Desc = 20,
            Title = 30,
            ....
        }

public class Article
{
        public string Value {get; set; } 
        public string Desc {get; set; } 
        public Type Type {get; set; }
       
}

Do you have any ideas?

avava
  • 3
  • 3
  • 2
    It's not clear what you are asking. Could you try to explain what the problem with your code is right now? Please do that by pressing [edit] on the question – Xerillio Dec 06 '20 at 19:05
  • I have tried to make it more clear, sorry for that – avava Dec 06 '20 at 19:24

0 Answers0