-1

i have custom type i created as below

 public class FileTypeData
{
    //AAAL ;Indicator;EMA7;1;1

    public static List<FileTypeData> Data = new List<FileTypeData>();

    public string Symbol { get; set; }
    public string Catogery { get; set; }
    public string Indicator { get; set; }
    public string Signal { get; set; }

    public int Buy { get; set; }
    public int Hold { get; set; }
    public int Sell { get; set; }
    public int Wait { get; set; }

} 

i defined three list of my custom type and try to sellect all data from them as below:

 var result = from Daily in CandelDataDaily
from Weekly in CandelDataWeekly
from Monthly in CandelDataMonthly
select new
{
d=Daily.Indicator,
w=Weekly.Indicator,
m= Monthly.Indicator
};

when the three list have data it working fine ,but problem appears if one of them has account=0 means no data the result return empty, i want to select all data without any join without any condition and so no data in any.

expected result:

Daily   Weekly   Monthly
 xx       yy                                                                                                
 zz       ss       mm
          dd       rr

Thanks

Hanaa Gebril
  • 187
  • 1
  • 13

1 Answers1

0

i solved it without linq as it is not give me what i want either left of outer or both . my solution: `int TotalCount = CandelDataDaily.Count + CandelDataWeekly.Count + CandelDataMonthly.Count; int D_count = CandelDataDaily.Count; int W_count = CandelDataWeekly.Count; int M_count = CandelDataMonthly.Count;

        for (int i = 0; i < TotalCount; i++)
        {
            if (D_count == 0 && W_count == 0 && M_count == 0) break;

            if (D_count == 0) Data.Append("N/A").Append(";");
            else { Data.Append(CandelDataDaily[i].Indicator).Append(";"); D_count--; }

            if (W_count == 0) Data.Append("N/A").Append(";");
            else { Data.Append(CandelDataWeekly[i].Indicator).Append(";"); W_count--; }

            if (M_count == 0) Data.Append("N/A").Append(Environment.NewLine);
            else { Data.Append(CandelDataMonthly[i].Indicator).Append(Environment.NewLine); ; M_count--; }                
        }`
Hanaa Gebril
  • 187
  • 1
  • 13