Store Data In a Generic List and use Linq
<p>Model.cs contains the Data of the User which is stored in a list type Now We have to fetch all those students whose <code>age</code> is more than <code>25</code>.</p>

<pre><code>public class Model
{
    public int Age { get; set; }
    public string Name { get; set; }
    public string Sports { get; set; }


        List&lt;Model&gt; objModels = new List&lt;Model&gt;() {
            new Model { Name = "Manish", Age = 27, Sports = "Cricket" },
            new Model { Name = "Rajan", Age = 25, Sports = "FootBall" },
            new Model { Name = "Prashant", Age = 25, Sports = "Kabaddi" },
            new Model { Name = "Garima", Age = 24, Sports = "Ludo" },
            new Model { Name = "Neha", Age = 25, Sports = "Carom" }
        };
    }
</code></pre>

<p>ModelController.cs</p>

<pre><code>public class ModelController : Controller
    {

        // GET: Model
        public ActionResult Index()
        {
            List&lt;Model&gt; objModel = new List&lt;Model&gt;();
            var query = from models in objModel select models;
            foreach(var item in query.ToList())
            {
                objModel.Add(
                    new Model
                    {
                        Name = item.Name.ToString(),
                        Age = int.Parse(item.Age.ToString()),
                        Sports = item.Sports.ToString()
                    });

            }
            return View(objModel);
        }
    }
</code></pre>

<p>But The object is always <code>empty</code> because it is not fetching the data from the model class. </p>