/// <summary> /// このインスタンスを、それと同等なUtility.Models.Entites.DtDevice型に変換する。 /// 子エンティティとして生成するため、親エンティティの情報をもたない /// </summary> /// <returns></returns> public Utility.Models.Entites.DtDevice ToChildModel(Type parentType) { Utility.Models.Entites.DtDevice model = ToModelCommonPart(); model.DtDeliveryResult = this.DtDeliveryResultDeviceS.Select(y => y.ToChildModel(this.GetType())).ToHashSet(); model.DtDeliveryResult1 = this.DtDeliveryResultGwDeviceS.Select(y => y.ToChildModel(this.GetType())).ToHashSet(); model.DtDeviceFile = this.DtDeviceFile.Select(y => y.ToChildModel(this.GetType())).ToHashSet(); model.DtDirectoryUsage = this.DtDirectoryUsage.Select(y => y.ToChildModel(this.GetType())).ToHashSet(); model.DtDiskDrive = this.DtDiskDrive.Select(y => y.ToChildModel(this.GetType())).ToHashSet(); model.DtDrive = this.DtDrive.Select(y => y.ToChildModel(this.GetType())).ToHashSet(); model.DtDxaBillLog = this.DtDxaBillLog.Select(y => y.ToChildModel(this.GetType())).ToHashSet(); model.DtDxaQcLog = this.DtDxaQcLog.Select(y => y.ToChildModel(this.GetType())).ToHashSet(); model.DtEquipmentUsage = this.DtEquipmentUsage.Select(y => y.ToChildModel(this.GetType())).ToHashSet(); model.DtInstallResult = this.DtInstallResult.Select(y => y.ToChildModel(this.GetType())).ToHashSet(); model.DtInventory = this.DtInventory.Select(y => y.ToChildModel(this.GetType())).ToHashSet(); model.DtParentChildConnect = this.DtParentChildConnectChildDeviceS.Select(y => y.ToChildModel(this.GetType())).ToHashSet(); model.DtParentChildConnect1 = this.DtParentChildConnectParentDeviceS.Select(y => y.ToChildModel(this.GetType())).ToHashSet(); model.DtPlusServiceBillLog = this.DtPlusServiceBillLog.Select(y => y.ToChildModel(this.GetType())).ToHashSet(); model.DtSoftVersion = this.DtSoftVersion.Select(y => y.ToChildModel(this.GetType())).ToHashSet(); // 親子間の参照無限ループを避けるためにタイプチェック if (this.ConnectStatusS?.GetType() != parentType) { model.MtConnectStatus = this.ConnectStatusS?.ToParentModel(this.GetType()); } if (this.InstallTypeS?.GetType() != parentType) { model.MtInstallType = this.InstallTypeS?.ToParentModel(this.GetType()); } if (this.EquipmentModelS?.GetType() != parentType) { model.MtEquipmentModel = this.EquipmentModelS?.ToParentModel(this.GetType()); } return(model); }
/// <summary> /// このインスタンスを、それと同等なUtility.Models.Entites.DtDevice型に変換する。 /// 各変換メソッド共通部分 /// </summary> /// <returns></returns> private Utility.Models.Entites.DtDevice ToModelCommonPart() { Utility.Models.Entites.DtDevice model = new Utility.Models.Entites.DtDevice(); model.Sid = this.Sid; model.EquipmentModelSid = this.EquipmentModelSid; model.InstallTypeSid = this.InstallTypeSid; model.ConnectStatusSid = this.ConnectStatusSid; model.EdgeId = this.EdgeId; model.EquipmentUid = this.EquipmentUid; model.RemoteConnectUid = this.RemoteConnectUid; model.RmsSoftVersion = this.RmsSoftVersion; model.ConnectStartDatetime = this.ConnectStartDatetime; model.ConnectUpdateDatetime = this.ConnectUpdateDatetime; model.CreateDatetime = this.CreateDatetime; model.UpdateDatetime = this.UpdateDatetime; return(model); }
/// <summary> /// コンストラクタ /// </summary> /// <param name="model">Utility.Models.Entites.DtDeviceのインスタンス</param> public DtDevice(Utility.Models.Entites.DtDevice model) { this.Sid = model.Sid; this.EquipmentModelSid = model.EquipmentModelSid; this.InstallTypeSid = model.InstallTypeSid; this.ConnectStatusSid = model.ConnectStatusSid; this.EdgeId = model.EdgeId; this.EquipmentUid = model.EquipmentUid; this.RemoteConnectUid = model.RemoteConnectUid; this.RmsSoftVersion = model.RmsSoftVersion; this.ConnectStartDatetime = model.ConnectStartDatetime; this.ConnectUpdateDatetime = model.ConnectUpdateDatetime; this.CreateDatetime = model.CreateDatetime; this.UpdateDatetime = model.UpdateDatetime; this.DtDeliveryResultDeviceS = model.DtDeliveryResult.Select(y => new DtDeliveryResult(y)).ToHashSet(); this.DtDeliveryResultGwDeviceS = model.DtDeliveryResult1.Select(y => new DtDeliveryResult(y)).ToHashSet(); this.DtDeviceFile = model.DtDeviceFile.Select(y => new DtDeviceFile(y)).ToHashSet(); this.DtDirectoryUsage = model.DtDirectoryUsage.Select(y => new DtDirectoryUsage(y)).ToHashSet(); this.DtDiskDrive = model.DtDiskDrive.Select(y => new DtDiskDrive(y)).ToHashSet(); this.DtDrive = model.DtDrive.Select(y => new DtDrive(y)).ToHashSet(); this.DtDxaBillLog = model.DtDxaBillLog.Select(y => new DtDxaBillLog(y)).ToHashSet(); this.DtDxaQcLog = model.DtDxaQcLog.Select(y => new DtDxaQcLog(y)).ToHashSet(); this.DtEquipmentUsage = model.DtEquipmentUsage.Select(y => new DtEquipmentUsage(y)).ToHashSet(); this.DtInstallResult = model.DtInstallResult.Select(y => new DtInstallResult(y)).ToHashSet(); this.DtInventory = model.DtInventory.Select(y => new DtInventory(y)).ToHashSet(); this.DtParentChildConnectChildDeviceS = model.DtParentChildConnect.Select(y => new DtParentChildConnect(y)).ToHashSet(); this.DtParentChildConnectParentDeviceS = model.DtParentChildConnect1.Select(y => new DtParentChildConnect(y)).ToHashSet(); this.DtPlusServiceBillLog = model.DtPlusServiceBillLog.Select(y => new DtPlusServiceBillLog(y)).ToHashSet(); this.DtSoftVersion = model.DtSoftVersion.Select(y => new DtSoftVersion(y)).ToHashSet(); this.ConnectStatusS = model.MtConnectStatus == null ? null : new MtConnectStatus(model.MtConnectStatus); this.InstallTypeS = model.MtInstallType == null ? null : new MtInstallType(model.MtInstallType); this.EquipmentModelS = model.MtEquipmentModel == null ? null : new MtEquipmentModel(model.MtEquipmentModel); }