using System.Collections.Generic;
public static void Main()
Console.WriteLine("Hello World");
List<ReceiptResponse> MyList = null;
var t1 = MyList?[0]?.FileName;
Console.WriteLine("pass#1");
var t2 = MyList?.FirstOrDefault()?.FileName;
Console.WriteLine("pass#2");
Console.Write(t1 ?? "t1 null", t2 ?? "t2 null");
public class ReceiptResponse
public string FileName { get; set; }
public string ContentType { get; set; }
public Guid FacilityId { get; set; }
public Guid PatientID { get; set; }