Note that there are some explanatory texts on larger screens.

plurals
  1. POFilter list with particular value of class
    text
    copied!<p>I have a Responsiblity class, which contains some subclasses Below is the class:-</p> <pre><code>public class Responsibility { private Frequency _FrequencyInfo = new Frequency(); private ResponsibilityCategory _CategoryInfo = new ResponsibilityCategory(); private Status _StatusInfo = new Status(); public int ResponsibilityId { get; set; } public string ResponsibilityName { get; set; } public string Description { get; set; } public Frequency FrequencyInfo { get { return _FrequencyInfo; } set { _FrequencyInfo = value; } } public ResponsibilityCategory CategoryInfo { get { return _CategoryInfo; } set { _CategoryInfo = value; } } public Status StatusInfo { get { return _StatusInfo; } set { _StatusInfo = value; } } } </code></pre> <p>Below is the code i am using to bind the list.But i am getting all the elements of the class. I just wants two elements from the class.</p> <pre><code>Responsibility newResponsibilty = new Responsibility(); newResponsibilty.ResponsibilityId = ResponsibilityId; new iNGRID_Data.Ops.DataMethods().dbrGetResponsibilityDetailsInSpecifiedResponsibilty(ref newResponsibilty, ResponsibilityId, ref err); List&lt;Responsibility&gt; listResponsibilty = new List&lt;Responsibility&gt;(); listResponsibilty.Add(newResponsibilty); JavaScriptSerializer jsonserialize = new JavaScriptSerializer(); string result = jsonserialize.Serialize(listResponsibilty); return Content(result); </code></pre> <p>I want to serialize this list with just 2 objects ResponsibiltyName and Description. Please suggest.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload