Question: I am working on an Asp.net project using C#. I am facing a problem in this project. This task based on service scheduled according to condition.

**Problem:**

Two textboxes for dates, one dropdownlist for type

First I have selected two dates according to type generate scheduled.

For example:

I have selected dates `14/03/2014` to `14/6/2014` and type `Monthly`

Monthly means increase value by 1 month

So the output should look like this

```
14/04/2014
14/05/2014
14/06/2014

```

There are three dates that are scheduled between two date range

**Question:**

How to achieve this task ?

**Sorry for poor English.....**

Answer: 
Your code returns a list of all `Person` where `Active == true` if you want to get single person you can use 

```
var selected = m_PersonCollection.FirstOrDefault(t => t.Active == true)

```

or if there can be only one active person

```
var selected = m_PersonCollection.SingleOrDefault(t => t.Active == true)

```

in both cases `selected` will be single `Person` object, or null if none found
I am not sure what kind of data erson has but no need to use var and casting. try this one 

```
Person  objPerson = (from person in m_PersonCollection
                         where person.Active.Equals(true)
                          select new Person
                          {
                              // map your Person here
                              //I assume Person has name property
                                name = person.Name
                           }).FirstOrDefault();

```