Try following :
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Context _context = new Context()
{
BookingSet = new List<BookingSet>() {
new BookingSet() { FlightNo = 1, PassengerID = 32},
new BookingSet() { FlightNo = 1, PassengerID = 33},
new BookingSet() { FlightNo = 1, PassengerID = 34},
new BookingSet() { FlightNo = 1, PassengerID = 35},
new BookingSet() { FlightNo = 1, PassengerID = 36},
new BookingSet() { FlightNo = 1, PassengerID = 37},
new BookingSet() { FlightNo = 1, PassengerID = 38},
new BookingSet() { FlightNo = 1, PassengerID = 39},
new BookingSet() { FlightNo = 1, PassengerID = 40},
new BookingSet() { FlightNo = 1, PassengerID = 41},
new BookingSet() { FlightNo = 2, PassengerID = 42},
new BookingSet() { FlightNo = 2, PassengerID = 43},
new BookingSet() { FlightNo = 6, PassengerID = 44},
},
PassengerSet = new List<PassengerSet>() {
new PassengerSet() { PersonID = 32, Firstname = "Tony", Lastname = "Montana", IsBusiness = 1, TicketPrice = 1750.00M},
new PassengerSet() { PersonID = 33, Firstname = "Al", Lastname = "Capone", IsBusiness = 1, TicketPrice = 1750.00M},
new PassengerSet() { PersonID = 34, Firstname = "Nucky", Lastname = "Thompson", IsBusiness = 1, TicketPrice = 1750.00M},
new PassengerSet() { PersonID = 35, Firstname = "Sam", Lastname = "Giancana", IsBusiness = 1, TicketPrice = 1750.00M},
new PassengerSet() { PersonID = 36, Firstname = "Bugsy", Lastname = "Siegel", IsBusiness = 1, TicketPrice = 1750.00M},
new PassengerSet() { PersonID = 37, Firstname = "Vito", Lastname = "Genovese", IsBusiness = 1, TicketPrice = 1750.00M},
new PassengerSet() { PersonID = 38, Firstname = "Meyer", Lastname = "Lansky", IsBusiness = 1, TicketPrice = 1750.00M},
new PassengerSet() { PersonID = 39, Firstname = "John", Lastname = "Dillinger", IsBusiness = 1, TicketPrice = 1750.00M},
new PassengerSet() { PersonID = 30, Firstname = "Luciano", Lastname = "Lucky", IsBusiness = 1, TicketPrice = 1750.00M},
new PassengerSet() { PersonID = 41, Firstname = "Mickey", Lastname = "Cohen", IsBusiness = 1, TicketPrice = 1750.00M},
new PassengerSet() { PersonID = 42, Firstname = "Anakin", Lastname = "Skywalker", IsBusiness = 1, TicketPrice = 315.00M},
new PassengerSet() { PersonID = 43, Firstname = "Obi-Wan", Lastname = "Kenobi", IsBusiness = 1, TicketPrice = 315.00M},
new PassengerSet() { PersonID = 44, Firstname = "Ben", Lastname = "Solo", IsBusiness = 0, TicketPrice = 840.00M}
}
};
var results = (from b in _context.BookingSet
join p in _context.PassengerSet on b.PassengerID equals p.PersonID
select new { b = b, p = p }
).GroupBy(x => new { passengerID = x.b.PassengerID, flight = x.b.FlightNo })
.Select(x => new
{
flight = x.Key.flight,
firstName = x.First().p.Firstname,
lastName = x.First().p.Lastname,
totalPrice = x.Sum(y => y.p.TicketPrice)
}).ToList();
}
}
public class Context
{
public List<BookingSet> BookingSet { get; set; }
public List<PassengerSet> PassengerSet { get; set; }
}
public class BookingSet
{
public int FlightNo { get; set; }
public int PassengerID { get; set; }
}
public class PassengerSet
{
public int PersonID { get; set; }
public string Firstname { get; set; }
public string Lastname { get; set; }
public int IsBusiness { get; set; }
public decimal TicketPrice { get; set; }
}
}