Refactoring from .. in .. select to more compact one Is it possible to write the two following lines of code in a more compact one?

IEnumerable&lt;int&gt; collection = from partnerNumbers in contract.Contact.PartnerNumbers select partnerNumbers.Pnr;
var response = this.otherClass.SomeMethod(collection, DateTime.Now.Date);


Additional information:

public int SomeMethod(IEnumerable&lt;int&gt; partnerNumbers, DateTime startDate)
{
    ...
}

...

[Table("Conracts")]
public class Contract
{
    public virtual Contact contact
    {
        get;
        set;
    }
}

...

public class Contact
{
    public virtual Collection&lt;PartnerNumbers&gt; PartnerNumbers
    {
        get;
        private set;
    }
}

...

public class PartnerNumbers
{
    public int Id { get; set; }  
    public virtual int Pnr { get; set; }
    public string Information { get; set; }
    public virtual Contact contact { get; set; }
}
Idon't see why you would want to shorten that piece of code but here's the same result in one line and using a LinQ method-chain instead of query-syntax:

var response = otherClass.SomeMethod(contract.Contact.PartnerNumbers.Select(p =&gt; p.Pnr), DateTime.Now.Date);


Edit:

Since you have no parameters that have influence on the calculation of the response, here's a method for re-usability:

public int GetResponse()
{
    var collection = from partnerNumbers in contract.Contact.PartnerNumbers select partnerNumbers.Pnr;
    var response = this.otherClass.SomeMethod(collection, DateTime.Now.Date);
    return response;
}


or with LinQ method-chain:

public int GetResponse()
{
    return otherClass.SomeMethod(contract.Contact.PartnerNumbers.Select(p =&gt; p.Pnr), DateTime.Now.Date);
}