AIMS_BD_IATI.WebAPI.Controllers.IATIImportController.MergeToSingleActivity C# (CSharp) Method

MergeToSingleActivity() private static method

private static MergeToSingleActivity ( List iatiActivities ) : iatiactivity
iatiActivities List
return iatiactivity
        private static iatiactivity MergeToSingleActivity(List<iatiactivity> iatiActivities)
        {
            var groupedActivity = new iatiactivity();

            var trns = new List<transaction>();
            var bgts = new List<budget>();
            var plnDis = new List<planneddisbursement>();

            foreach (var activity in iatiActivities)
            {
                trns.AddRange(activity.transaction);
                bgts.AddRange(activity.budget);
                plnDis.AddRange(activity.planneddisbursement);
            }
            groupedActivity.transaction = trns.ToArray();
            groupedActivity.budget = bgts.ToArray();
            groupedActivity.planneddisbursement = plnDis.ToArray();

            return groupedActivity;
        }