skip to Main Content

I’m trying to parse dynamic value of MyValue :

MyValue has value like-> ValueKind = Number : "0"

The code is:

var pdfAttributeModelDataSet = JsonAttributeHealth.Select(x => new 
        {
            ResponsibilityInfo = x.PersianName,
            //YearlyResponsibility="",
            MyValue = x.Value,
        }).ToList();

2

Answers


  1. you can use

    Convert.ToString

    for your purpose and give the number of your string

    Login or Signup to reply.
  2. maybe it’s better to use javaScriptSerializer to serialize and de-serialize your data.

    public class Class1
    {
    
        public Class1()
        {        
       
          var param = user.PersianName + "," + user.Value;
          var javaScriptSerializer = new JavaScriptSerializer();
          var stringBuilder = new StringBuilder();
          javaScriptSerializer.Serialize(param, stringBuilder);
          ...
        }
    }
    
    internal class user
    {
        public static string PersianName {get; internal set;}
        public static string Value {get; internal set;}
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search