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
The [Where](http://msdn.microsoft.com/en-us/library/bb534803%28v=vs.110%29.aspx) will return `IEnumberable` but not the Person, use FirstOrDefault or Single to get object of type Person.

```
var selected = m_PersonCollection.FirstOrDefault(t => t.Active == true);  
Person person = selected as Person;

```