Ramco Ramco

Ramco Ramco

  • 441
  • 3.4k
  • 523.1k

Linq Query

Oct 6 2022 5:16 AM

Hi

  I want if there is value in Status then it should return only those records else it should return all records. 

List<View_Detail> Result = (from t in context.View_Details
                                                          where t.FromDate.Value.Date >= frDate.Date && t.FromDate.Value.Date <= toDate.Date
                                                          
                                                          && (t.Status != "" ? t.Status == TStatus.ToString() : 1 == 1)
                                                          
                                                          select t).ToList();
                return Result;

Thanks


Answers (2)