Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 组合多个DbQuery结果的最佳方法是什么?_C#_Asp.net Mvc_Linq_Kendo Asp.net Mvc - Fatal编程技术网

C# 组合多个DbQuery结果的最佳方法是什么?

C# 组合多个DbQuery结果的最佳方法是什么?,c#,asp.net-mvc,linq,kendo-asp.net-mvc,C#,Asp.net Mvc,Linq,Kendo Asp.net Mvc,我正在创建一个巨大的网格,显示数据库中4个表中所有不同的记录类型。我创建了一个viewmodel,它保存每个记录类型的每个字段,然后进行查询以获取每个字段,并为每个字段创建一个viewmodel对象。现在,我想将所有这些合并成一个大结果,并返回到我的视图,以便可以显示网格中的所有内容。以下是获取所有日志类型的函数: public ActionResult GetAllLogs([DataSourceRequest]DataSourceRequest request) {

我正在创建一个巨大的网格,显示数据库中4个表中所有不同的记录类型。我创建了一个viewmodel,它保存每个记录类型的每个字段,然后进行查询以获取每个字段,并为每个字段创建一个viewmodel对象。现在,我想将所有这些合并成一个大结果,并返回到我的视图,以便可以显示网格中的所有内容。以下是获取所有日志类型的函数:

    public ActionResult GetAllLogs([DataSourceRequest]DataSourceRequest request)
    {
        //var result;
        var allAssetConfigLogs = DbContext.AssetConfigurations.Select(log => new Models.AllLogsViewModel()
        {
            ID = log.Asset_SK.Value,
            AssetConfigurationID = log.AssetConfiguration_SK,
            AssetID = log.Asset_SK.Value,
            AssetName = log.Asset.Name,
            RedConID = log.ReadinessCondition_SK,
            RedCon = log.ReadinessCondition.Name,
            EKVType = log.EKV_Type_SK,
            IsSSF = log.IsSSF,
            IsArmedPlug = log.IsArmedPlug,
            IsConnectedCommunications = log.IsConnectedCommunications,
            IsFutureCapable = log.IsFutureCapable,
            IsFutureCapableLongTerm = log.IsFutureCapableLongTerm,
            IsActive = log.IsActive,
            IsExternal = log.IsExternal,
            IsIsolationComponent = log.IsIsolationComponent,
            IsIsolationSerial = log.IsIsolationSerial,
            IsInMaintenanceMode = log.IsInMaintenanceMode,
            IsEWCS = log.IsEWCS,
            IsMBIT = log.IsMBIT,
            IsIcoBsc = log.IsIcoBsc,
            IsLocal = log.IsLocal,
            IsStop = log.IsStop,
            IsSurge = log.IsSurge,
            ACNotes = log.Notes,
            SoftwareVersion = log.SoftwareVersion,
            IsIsolationSwitchPort = log.IsIsolationSwitchPort,
            IsPortManagedDown = log.IsPortManagedDown,
            IsOsfLogical = log.IsOsfLogical,
            ShipName = log.ShipName,
            JUNumber = log.JU_Number,
            GMACKey = log.GMAC_Key,
            URN = log.URN,
            TimeStamp = log.TimeStamp,
        });

        var allMissionLogs = DbContext.MissionConfigurations.Select(log => new Models.AllLogsViewModel()
        {
            MissionConfiguration_SK = log.MissionConfiguration_SK,
            Asset_SK = log.Asset_SK,
            EventType_SK = log.EventType_SK,
            Environment_SK = log.Environment_SK,
            RedConID = log.ReadinessCondition_SK,
            RecallTime = log.RecallTime,
            Notes = log.Notes
        });

        var allPACLogs = DbContext.PAC_Logs.Select(log => new Models.AllLogsViewModel()
        {
            UserRole = String.Join(",", log.User.Roles),
            PacLogID = log.PAC_Log_SK,
            SiteID = log.Site_SK,
            PacLogStatusID = log.PAC_LogStatus_SK,
            Status = log.PAC_LogStatus.Description,
            StatusDate = log.StatusDate,
            ActivityDescription = log.ActivityDescription,
            ActivityDetailDescription = log.ActivityDetailDescription,
            TrackingNumber = log.TrackingNumber,
            QuickTrack = log.QuickTrack,
            WAM_Number = log.WAM_Number,
            WAM_Revision = log.WAM_Revision,
            RequestedBy = log.RequestedBy,
            RequestedByName = log.User1 != null ? log.User1.FirstName + " " + log.User1.LastName : "",
            Controller = log.Controller,
            ControllerName = log.User2 != null ? log.User2.FirstName + " " + log.User2.LastName : "",
            AuthorizationNumber = log.AuthorizationNumber,
            IsSafe = log.IsSafe,
            SafeComments = log.SafeComments,
            PlanStartZulu = log.PlanStartZulu,
            PlanFinishZulu = log.PlanFinishZulu,
            ActualStartZulu = log.ActualStartZulu,
            ActualFinishZulu = log.ActualFinishZulu,
            PlanStartLocal = log.PlanStartLocal,
            PlanFinishLocal = log.PlanFinishLocal,
            ActualStartLocal = log.ActualStartLocal,
            ActualFinishLocal = log.ActualFinishLocal,
            IsGovDirected = log.IsGovernmentDirected,
            POC = log.POC,
            POCPhone = log.POC_Phone,
            WorkOrder = log.WorkOrder,
            ApprovalAuthority = log.ApprovalAuthority,
            AuthorityDocument = log.AuthorityDocument,
            FinalVerification = log.FinalVerification,
            WindowActivity = log.WindowActivities,
            APAC = log.APAC,
            WAMStartZulu = log.WAMStartZulu,
            WAMFinishZulu = log.WAMFinishZulu,
            AssetAvailable = log.AssetAvailable,
            AssetUnavailable = log.AssetUnavailable,
            AssetStatus = log.MaintenanceStatus_SK,
            AssetStatusString = log.MaintenanceStatu.Name,
            ID_MaintenanceActivity = log.MaintenanceActivity_SK,
            ID_MaintenanceActivityString = log.MaintenanceActivity.Name,
            FourtyMinuteNotification = log.C40MinNotification,
            Comments = log.Comments,
            QAComments = log.QA_Comments,
            QACheck = log.QA_Check,
            Unscheduled = log.Unscheduled,
            SiteName = log.Site.FullName,
            Environment1 = log.Environment1,
            Environment2 = log.Environment2,
            Environment3 = log.Environment3,
            TimeZoneID = log.TimeZone_SK,
            TimeZone = log.TimeZone.Name,
            TimeZoneOffset = log.TimeZone_SK != null ? log.TimeZone.Offset.Value : 0,
            AssetCheck = log.AssetLogPAC_Logs.Count > 0 ? "yes" : "",
            EnvironmentCheck = log.Environment1 || log.Environment2 || log.Environment3 ? "yes" : ""
        });

        var allPRs = DbContext.ProblemReports.Select(log => new Models.AllLogsViewModel()
        {
            ProblemReportID = log.ProblemReport_SK,
            ProblemReportOwnerID = log.ProblemReportOwner_SK,
            EventID = log.Event_SK,
            EventString = log.Event.Name,
            SubAssembly = log.Subassembly_SK,
            SubAssemblyString = log.Subassembly.Name,
            ActualFailureTime = log.ActualFailureTime,
            ActualRestoreTime = log.ActualRestoreTime,
            CurrentDateTimeGroup = log.CurrentDateTimeGroup,
            FaultEventDescription = log.FaultEventDescription,
            FaultEventDetails = log.FaultEventDetails,
            CurrentDayActivities = log.CurrentDayActivities,
            PathForward = log.PathForward,
            EstimatedArrivalDate = log.EstimatedArrivalDate,
            WorkOrderNumber = log.WorkOrderNumber,
            NCR_Number = log.NCR_Number,
            MalfunctionNotes = log.MalfunctionNotes,
            RepairStatus = log.RepairStatus,
            NextUpdateDue = log.NextUpdateDue,
            OriginatedBy = log.OriginatedBy,
            OriginatedByString = log.User.FirstName + " " + log.User.LastName,
            ReleasedBy = log.ReleasedBy,
            ReleasedByString = log.ReleasedBy != null ? log.User1.FirstName + " " + log.User1.LastName : "",
            ClosedBy = log.ClosedBy,
            ClosedByString = log.ClosedBy != null ? log.User2.FirstName + " " + log.User2.LastName : "",
            IsClosed = log.IsClosed,
            IsNotesVisible = log.IsNotesVisible,
            TimeStamp = log.TimeStamp,
            RedConID = log.ReadinessCondition_SK,
            RedCon = log.ReadinessCondition.Name,
            AssetType = log.Asset.AssetType.Name,
            AssetSite = log.Asset.Site.Name,
            Rev = log.ProblemReportDetails.OrderByDescending(x => x.CreatedBy).FirstOrDefault().Revision.Name,
            ETRO = log.ProblemReportDetails.OrderByDescending(x => x.CreatedBy).FirstOrDefault().ETRO.ToString(),
            ETROChangeReason = log.ProblemReportDetails.OrderByDescending(x => x.CreatedBy).FirstOrDefault().ETRO_ChangeReasons.Name,
            NoteArchive = log.NotesArchive,
            currentDetail = log.ProblemReportDetails.OrderByDescending(y => y.CreatedOn).FirstOrDefault(),
            RelatedAssetEnv = DbContext.MissionConfigurations.Where(y => y.Asset_SK == log.Asset.Asset_SK).OrderByDescending(y => y.TimeStamp).Select(y => y.Environment.EnvironmentLogs.OrderByDescending(z => z.TimeStamp).FirstOrDefault().Designation).FirstOrDefault()
        });

        //return Json(result.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
    }
My Giant ViewModel(将不同日志类型的不同字段合并为一个大模型):

`//这是一个将所有日志类型(与资产相关)合并为一个的模型。
公共类AllLogsViewModel
{
//此区域包含多个日志类型共享的字段。
#区域共享字段
公共int ID{get;set;}
公共字符串RedCon{get;set;}
public int RedConID{get;set;}
公共日期时间时间戳{get;set;}
公共字符串时间戳字符串
{
获取{return TimeStamp.ToString();}
}
公共字符串ZULU
{
获取{return TimeStamp.ToString(“MM'/'dd'/'yyyy''HHmm'z'”;}
}
通过{get;set;}创建的公共字符串
public DateTime CreatedOn{get;set;}
公共字符串CreatedOnString
{
获取{return CreatedOn.ToString();}
}
公共字符串CreatedOnStringZulu
{
获取{return CreatedOn.ToString(“MM'/'dd'/'yyyy''HHmm'z');}
}
由{get;set;}更新的公共字符串
public DateTime UpdatedOn{get;set;}
公共字符串更新安装
{
获取{return UpdatedOn.ToString();}
}
公共字符串更新安装ZULU
{
获取{return UpdatedOn.ToString(“MM'/'dd'/'yyyy''HHmm'z'”;}
}
#端区
#区域资产配置
公共int资产配置ID{get;set;}
公共int AssetID{get;set;}
公共字符串AssetName{get;set;}
public int EKVType{get;set;}
//出于某种原因被标记为“OSF物理”?
公共布尔IsSSF{get;set;}
公共布尔值IsArmedPlug{get;set;}
公共布尔IsArmedSDS{get;set;}
公共广播已连接通信{get;set;}
公共布尔值可用于未来{get;set;}
公共布尔是未来可长期{get;set;}
公共bool IsActive{get;set;}
公共bool IsExternal{get;set;}
公共布尔ISIsIsolationComponent{get;set;}
公共布尔ISIsIsolationSerial{get;set;}
公共bool是维护模式{get;set;}
公共布尔IsEWCS{get;set;}
公共bool IsMBIT{get;set;}
公共bool-IsIcoBsc{get;set;}
公共布尔IsLocal{get;set;}
公共bool IsStop{get;set;}
公共bool IsSurge{get;set;}
公共字符串ACNotes{get;set;}
公共字符串软件版本{get;set;}
公共bool IsIsolationSwitchPort{get;set;}
公共bool IsPortManagedDown{get;set;}
公共布尔同构逻辑{get;set;}
公共字符串ShipName{get;set;}
公共字符串JUNumber{get;set;}
公共字符串GMACKey{get;set;}
公共字符串URN{get;set;}
//表单逻辑控件?
公共bool GMMVisibility{get;set;}
公共bool cnevibility{get;set;}
公共布尔{get;set;}
公共布尔IDTVisibility{get;set;}
公共bool aegis可见性{get;set;}
公共bool GMACVisibility{get;set;}
公共布尔值{get;set;}
公共bool ANTPY2Visibility{get;set;}
公共bool gbivilibility{get;set;}
公共布尔OSFVisibility{get;set;}
公共bool PortIsolationVisibility{get;set;}
public int assignedgbid{get;set;}
公共字符串AssignedGBIName{get;set;}
public int AssignedCNEID{get;set;}
公共字符串AssignedCNEName{get;set;}
#端区
#地区任务日志
公共int任务配置{get;set;}
公共int资产{get;set;}
public int EventType_SK{get;set;}
公共int环境_SK{get;set;}
公共字符串名称
{
得到
{
变量名称=string.Empty;
交换机(事件类型_SK)
{
案例5:名称=“通信”;
打破
案例8:名称=“OPS”;
打破
案例10:名称=“测试”;
打破
}
返回指定;
}
}//对于EventType_SK
公共int RecallTime{get;set;}
公共字符串注释{get;set;}
#端区
#区域PacLogs
公共字符串用户角色{get;set;}
公共字符串SubmitType{get;set;}
public int PacLogID{get;set;}
public int SiteID{get;set;}
public int?PacLogStatusID{get;set;}
公共字符串状态{get;set;}
公共日期时间状态日期{get;set;}
公共字符串StatusDateString
{
获取{return StatusDate.ToString();}
}
[显示名称(“状态日期”)]
公共字符串状态DateStringZulu
{
获取{return StatusDate.ToString(“MM'/'dd'/'yyyy''HHmm'z');}
}
公共字符串ActivityDescription{get;set;}
公共字符串ActivityDetailDescription{get;set;}
公共字符串跟踪编号{get;set;}
公共字符串快速跟踪{get;set;}
公共字符串WAM_编号{get;set;}
公共字符串WAM_修订版{get;set;}
公共int?由{get;set;}请求
公共字符串RequestedByName{get;set;}
公共int?控制器{get;set;}
公共字符串控制器名称{get;set;}
公共字符串授权编号{get;set;}
公共布尔IsSafe{get;set;}
公共字符串SafeComments{get;set;}
公共日期时间?PlanStartZulu{get;set;}
[显示名称(“计划启动”)]
公共字符串PlanStartzulString
{
获取{return PlanStartZulu?.ToString(“MM'/'dd'/'yyyy''HHmm'z'”;}
}
[Requ
`//This is a model of all log types (relating to assets) consolidated into one.
public class AllLogsViewModel
{
    //This region holds fields that are shared amongst multiple log types.
    #region SharedFields
    public int ID { get; set; }
    public string RedCon { get; set; }
    public int RedConID { get; set; }
    public DateTime TimeStamp { get; set; }
    public string TimeStampString
    {
        get { return TimeStamp.ToString(); }
    }
    public string TimeStampStringZulu
    {
        get { return TimeStamp.ToString("MM'/'dd'/'yyyy' 'HHmm'z'"); }
    }
    public string CreatedBy { get; set; }
    public DateTime CreatedOn { get; set; }
    public string CreatedOnString
    {
        get { return CreatedOn.ToString(); }
    }
    public string CreatedOnStringZulu
    {
        get { return CreatedOn.ToString("MM'/'dd'/'yyyy' 'HHmm'z'"); }
    }
    public string UpdatedBy { get; set; }
    public DateTime UpdatedOn { get; set; }
    public string UpdatedOnString
    {
        get { return UpdatedOn.ToString(); }
    }
    public string UpdatedOnStringZulu
    {
        get { return UpdatedOn.ToString("MM'/'dd'/'yyyy' 'HHmm'z'"); }
    }
    #endregion

    #region AssetConfigLogs
    public int AssetConfigurationID { get; set; }
    public int AssetID { get; set; }
    public string AssetName { get; set; }
    public int EKVType { get; set; }
    //Labeled as "OSF Physical" for some reason?
    public bool IsSSF { get; set; }
    public bool IsArmedPlug { get; set; }
    public bool IsArmedSDS { get; set; }
    public bool IsConnectedCommunications { get; set; }
    public bool IsFutureCapable { get; set; }
    public bool IsFutureCapableLongTerm { get; set; }
    public bool IsActive { get; set; }
    public bool IsExternal { get; set; }
    public bool IsIsolationComponent { get; set; }
    public bool IsIsolationSerial { get; set; }
    public bool IsInMaintenanceMode { get; set; }
    public bool IsEWCS { get; set; }
    public bool IsMBIT { get; set; }
    public bool IsIcoBsc { get; set; }
    public bool IsLocal { get; set; }
    public bool IsStop { get; set; }
    public bool IsSurge { get; set; }
    public string ACNotes { get; set; }
    public string SoftwareVersion { get; set; }
    public bool IsIsolationSwitchPort { get; set; }
    public bool IsPortManagedDown { get; set; }
    public bool IsOsfLogical { get; set; }
    public string ShipName { get; set; }
    public string JUNumber { get; set; }
    public string GMACKey { get; set; }
    public string URN { get; set; }
    //form logic controls?
    public bool GMMVisibility { get; set; }
    public bool CNEVisibility { get; set; }
    public bool SiloVisibility { get; set; }
    public bool IDTVisibility { get; set; }
    public bool AEGISVisibility { get; set; }
    public bool GMACVisibility { get; set; }
    public bool URNVisibility { get; set; }
    public bool ANTPY2Visibility { get; set; }
    public bool GBIVisibility { get; set; }
    public bool OSFVisibility { get; set; }
    public bool PortIsolationVisibility { get; set; }
    public int AssignedGBIID { get; set; }
    public string AssignedGBIName { get; set; }
    public int AssignedCNEID { get; set; }
    public string AssignedCNEName { get; set; }
    #endregion

    #region MissionLogs
    public int MissionConfiguration_SK { get; set; }
    public int Asset_SK { get; set; }
    public int EventType_SK { get; set; }
    public int Environment_SK { get; set; }
    public string Designation 
    {
        get
        {
            var designation = string.Empty;

            switch (EventType_SK)
            {
                case 5: designation = "COMM";
                    break;
                case 8: designation = "OPS";
                    break;
                case 10: designation = "TEST";
                    break;
            }
            return designation;
        }
    } //For EventType_SK
    public int RecallTime { get; set; }
    public string Notes { get; set; }
    #endregion

    #region PacLogs
    public string UserRole { get; set; }
    public string SubmitType { get; set; }
    public int PacLogID { get; set; }
    public int SiteID { get; set; }
    public int? PacLogStatusID { get; set; }
    public string Status { get; set; }
    public DateTime StatusDate { get; set; }
    public string StatusDateString
    {
        get { return StatusDate.ToString(); }
    }
    [DisplayName("Status Date")]
    public string StatusDateStringZulu
    {
        get { return StatusDate.ToString("MM'/'dd'/'yyyy' 'HHmm'z'"); }
    }
    public string ActivityDescription { get; set; }
    public string ActivityDetailDescription { get; set; }
    public string TrackingNumber { get; set; }
    public string QuickTrack { get; set; }
    public string WAM_Number { get; set; }
    public string WAM_Revision { get; set; }
    public int? RequestedBy { get; set; }
    public string RequestedByName { get; set; }
    public int? Controller { get; set; }
    public string ControllerName { get; set; }
    public string AuthorizationNumber { get; set; }
    public bool IsSafe { get; set; }
    public string SafeComments { get; set; }
    public DateTime? PlanStartZulu { get; set; }
    [DisplayName("Planned Start")]
    public string PlanStartZuluString
    {
        get { return PlanStartZulu?.ToString("MM'/'dd'/'yyyy' 'HHmm'z'"); }
    }
    [Required(ErrorMessage = "Planned Close is Required")]
    // changed to "Planned Close"
    public DateTime? PlanFinishZulu { get; set; }
    [DisplayName("Planned Close")]
    public string PlanFinishZuluString
    {
        get { return PlanFinishZulu?.ToString("MM'/'dd'/'yyyy' 'HHmm'z'"); }
    }
    public DateTime? ActualStartZulu { get; set; }
    [DisplayName("Actual Start")]
    public string ActualStartZuluString
    {
        get { return ActualStartZulu?.ToString("MM'/'dd'/'yyyy' 'HHmm'z'"); }
    }
    public DateTime? ActualFinishZulu { get; set; }
    [DisplayName("Actual Close")]
    public string ActualFinishZuluString
    {
        get { return ActualFinishZulu?.ToString("MM'/'dd'/'yyyy' 'HHmm'z'"); }
    }
    public DateTime? PlanStartLocal { get; set; }
    [DisplayName("Planned Start(Local)")]
    public string PlanStartLocalString
    {
        get { return PlanStartLocal?.ToString(); }
    }
    public DateTime? PlanFinishLocal { get; set; }
    [DisplayName("Planned Close(Local)")]
    public string PlanFinishLocalString
    {
        get { return PlanFinishLocal?.ToString(); }
    }
    public DateTime? ActualStartLocal { get; set; }
    [DisplayName("Actual Start(Local)")]
    public string ActualStartLocalString
    {
        get { return ActualStartLocal?.ToString(); }
    }
    public DateTime? ActualFinishLocal { get; set; }
    [DisplayName("Actual Close(Local)")]
    public string ActualFinishLocalString
    {
        get { return ActualFinishLocal?.ToString(); }
    }
    public bool IsGovDirected { get; set; }
    public string POC { get; set; }
    public string POCPhone { get; set; }
    public string WorkOrder { get; set; }
    public string ApprovalAuthority { get; set; }
    public string AuthorityDocument { get; set; }
    public int? FinalVerification { get; set; }
    public string FinalVerificationString { get; set; }
    public bool WindowActivity { get; set; }
    public bool APAC { get; set; }
    public DateTime? WAMStartZulu { get; set; }
    [DisplayName("WAM Start")]
    public string WAMStartZuluString
    {
        get { return WAMStartZulu?.ToString("MM'/'dd'/'yyyy' 'HHmm'z'"); }
    }
    public DateTime? WAMFinishZulu { get; set; }
    [DisplayName("WAM Finish")]
    public string WAMFinishZuluString
    {
        get { return WAMFinishZulu?.ToString("MM'/'dd'/'yyyy' 'HHmm'z'"); }
    }
    public DateTime? AssetAvailable { get; set; }
    public string AssetAvailableString
    {
        get { return AssetAvailable?.ToString(); }
    }
    [DisplayName("Asset Available")]
    public string AssetAvailableStringZulu
    {
        get { return AssetAvailable?.ToString("MM'/'dd'/'yyyy' 'HHmm'z'"); }
    }
    public DateTime? AssetUnavailable { get; set; }
    public string AssetUnavailableString
    {
        get { return AssetUnavailable?.ToString(); }
    }
    [DisplayName("Asset Unavailable")]
    public string AssetUnavailableStringZulu
    {
        get { return AssetUnavailable?.ToString("MM'/'dd'/'yyyy' 'HHmm'z'"); }
    }
    public int? AssetStatus { get; set; }
    public string AssetStatusString { get; set; }
    // renamed to Activity Category
    public int? ID_MaintenanceActivity { get; set; }
    // renamed to Activity Category
    public string ID_MaintenanceActivityString { get; set; }
    public string FourtyMinuteNotification { get; set; }
    public string Comments { get; set; }
    public string QAComments { get; set; }
    public bool QACheck { get; set; }
    public bool Unscheduled { get; set; }
    public string TemplateName { get; set; }
    public string SiteName { get; set; }
    public bool Environment1 { get; set; }
    public bool Environment2 { get; set; }
    public bool Environment3 { get; set; }
    public string Environments
    {
        get
        {
            var envs = "";
            if (Environment1)
            {
                envs += "1";
                if (Environment2 || Environment3)
                {
                    envs += ", ";
                }
            }
            if (Environment2)
            {
                envs += "2";
                if (Environment3)
                {
                    envs += ", ";
                }
            }
            if (Environment3)
            {
                envs += "3";
            }

            return envs;
        }
    }
    public int? TimeZoneID { get; set; }
    public string TimeZone { get; set; }
    public int TimeZoneOffset { get; set; }
    public string AssetCheck { get; set; }
    public string EnvironmentCheck { get; set; }
    #endregion

    #region ProblemReports
    public int ProblemReportID { get; set; }
    public string ProblemReportIDString { get; set; }
    public int? ProblemReportOwnerID { get; set; }
    public int EventID { get; set; }
    public string EventString { get; set; }
    public int? SubAssembly { get; set; }
    public string SubAssemblyString { get; set; }
    public DateTime? ActualFailureTime { get; set; }
    public string ActualFailureTimeString
    {
        get { return ActualFailureTime?.ToString(); }
    }
    [DisplayName("Actual Failure Time")]
    public string ActualFailureTimeStringZulu
    {
        get { return ActualFailureTime?.ToString("MM'/'dd'/'yyyy' 'HHmm'z'"); }
    }
    public DateTime? ActualRestoreTime { get; set; }
    public string ActualRestoreTimeString
    {
        get { return ActualRestoreTime?.ToString(); }
    }
    [DisplayName("Actual Restore Time")]
    public string ActualRestoreTimeStringZulu 
    {
        get { return ActualRestoreTime?.ToString("MM'/'dd'/'yyyy' 'HHmm'z'"); }
    }
    public DateTime? CurrentDateTimeGroup { get; set; }
    public string CurrentDateTimeGroupString
    {
        get { return CurrentDateTimeGroup?.ToString(); }
    }
    [DisplayName("Current DateTime Group")]
    public string CurrentDateTimeGroupStringZulu
    {
        get { return CurrentDateTimeGroup?.ToString("MM'/'dd'/'yyyy' 'HHmm'z'"); }
    }
    public string FaultEventDescription { get; set; }
    public string FaultEventDetails { get; set; }
    public string CurrentDayActivities { get; set; }
    public string PathForward { get; set; }
    public string PartNumber { get; set; }
    public DateTime? EstimatedArrivalDate { get; set; }
    public string EstimatedArrivalDateString
    {
        get { return EstimatedArrivalDate?.ToString(); }
    }
    [DisplayName("Estimated Arrival Date")]
    public string EstimatedArrivalDateStringZulu
    {
        get { return EstimatedArrivalDate?.ToString("MM'/'dd'/'yyyy' 'HHmm'z'"); }
    }
    public string WorkOrderNumber { get; set; }
    public string NCR_Number { get; set; }
    public string MalfunctionNotes { get; set; }
    public string RepairStatus { get; set; }
    public DateTime? NextUpdateDue { get; set; }
    public string NextUpdateDueString
    {
        get { return NextUpdateDue?.ToString(); }
    }
    [DisplayName("Next Update Due")]
    public string NextUpdateDueStringZulu
    {
        get { return NextUpdateDue?.ToString("MM'/'dd'/'yyyy' 'HHmm'z'"); }
    }
    public int OriginatedBy { get; set; }
    public string OriginatedByString { get; set; }
    public int? ReleasedBy { get; set; }
    public string ReleasedByString { get; set; }
    public int? ClosedBy { get; set; }
    public string ClosedByString { get; set; }
    public bool IsClosed { get; set; }
    public bool IsNotesVisible { get; set; }
    public string TimeStampZuluString
    {
        get { return TimeStamp.ToString("MM'/'dd'/'yyyy' 'HHmm'z'"); }
    }
    [DisplayName("TimeStamp")]
    public string TimeStampZuluStringZulu
    {
        get { return TimeStamp.ToString("MM'/'dd'/'yyyy' 'HHmm'z'"); }
    }

    public string AssetType { get; set; }
    public string AssetSite { get; set; }
    public string Rev { get; set; }
    public string ETRO { get; set; }
    [DisplayName("ETRO")]
    public string ETROzulu
    {
        get
        {
            if (DateTime.TryParse(ETRO, out DateTime temp))
            {
                return DateTime.Parse(ETRO).ToString("MM'/'dd'/'yyyy' 'HHmm'z'");
            }
            else
            {
                return ETRO;
            }
        }
    }
    public string ETROChangeReason { get; set; }
    public string NoteArchive { get; set; }

    public DAL.ProblemReportDetail currentDetail { get; set; }
    public Models.ProblemReportDetails currentDetailModel { get; set; }
    [DisplayName("Owner")]
    public string ProblemReportOwnerString { get; set; }
    public List<Models.ProblemReportDetails> RelatedPRDetails { get; set; }
    public string RelatedAssetEnv { get; set; }
    #endregion

    #region ProblemReportDetails
    public int ProblemReportDetailID { get; set; }
    public int RevisionID { get; set; }
    public bool HasParent { get; set; }
    public DateTime? EventDate { get; set; }
    public string EventDateString
    {
        get { return EventDate?.ToString(); }
    }
    public string EventDateStringZulu
    {
        get { return EventDate?.ToString("MM'/'dd'/'yyyy' 'HHmm'z'"); }
    }
    public int ProblemReportTypeID { get; set; }
    public string ProblemReportType { get; set; }
    public int? MaintenancePriorityID { get; set; }
    public string MaintenancePriority { get; set; }
    public int MaintenanceStatusID { get; set; }
    public string MaintenanceStatus { get; set; }
    public int? ParentMaintenanceStatus { get; set; }
    public string ParentMaintenanceStatusString { get; set; }
    public int DetailRedConID { get; set; }
    public string DetailRedConString { get; set; }
    public string ETRO_String { get; set; }
    public int? ETROChangeReasonID { get; set; }
    public string ETROChangeReasonString { get; set; }
    #endregion
}
var allLogs = allAssetConfigLogs
  .Concat(allMissionLogs)
  .Concat(allPACLogs)
  .Concat(allPRs);