Hi have 3 list of models that holds odd number of elements and their are all joining by userId.
These 3 list of models in the real world it would take data from 3 stored procedures on a execution. I am trying to use Linq to right outer join them, "Which i don't know how to". I know there is a left join in Linq but say if a situation arises where the first list gets populated and then before the second and/or third list gets populated a new user gets added with relevant data for all 3 tables. So the new user data will be on the second and third table but not the first table and I want all the data to be displayed for my ViewModel after i put them to gather with Linq ? This is when you need right joins as you want to show nulls on the left table data.
Would anyone know if there is a way to do a right join for this or is there a better way? Below is the 3 List of object, which I need to put them to gather for my Viewmodel using Linq.
Please do advice.
B
class Program
{
static void Main(string[] args)
{
List<CommissionBrokerReport> dailyReports = new List<CommissionBrokerReport>(new CommissionBrokerReport[]
{
new CommissionBrokerReport { userId = 101, firstName = "Bruce", lastName = "Wayne", value = 17433.3333M, average = 0M },
new CommissionBrokerReport { userId = 303, firstName = "Selina", lastName = "Kyle", value = 7279.13M, average = 0M }
});
List<CommissionBrokerReport> weeklyReports = new List<CommissionBrokerReport>(new CommissionBrokerReport[]
{
new CommissionBrokerReport { userId = 101, value = 0M, average = 7532.9167M },
new CommissionBrokerReport { userId =303, value = 0M, average = 0M },
new CommissionBrokerReport { userId = 404, value = 33.3333M, average = 666.6666M }
});
List<CommissionBrokerReport> monthlyReports = new List<CommissionBrokerReport>(new CommissionBrokerReport[]
{
new CommissionBrokerReport { userId = 101, value = 37550.0000M, average = 4653.7500M },
new CommissionBrokerReport { userId = 303, value = 0M, average = 0M },
new CommissionBrokerReport { userId = 404, value = 33.3333M, average = 666.6666M },
new CommissionBrokerReport { userId = 505, value = 55.5555M, average = 10000.0000M }
});
}
}