/// <summary> /// このインスタンスを、それと同等なUtility.Models.Entites.DtDeliveryGroup型に変換する。 /// </summary> /// <returns></returns> public Utility.Models.Entites.DtDeliveryGroup ToModel() { Utility.Models.Entites.DtDeliveryGroup model = ToModelCommonPart(); model.DtDeliveryResult = this.DtDeliveryResult.Select(y => y.ToChildModel(this.GetType())).ToHashSet(); model.DtDeliveryFile = this.DeliveryFileS?.ToParentModel(this.GetType()); model.MtDeliveryGroupStatus = this.DeliveryGroupStatusS?.ToParentModel(this.GetType()); return(model); }
/// <summary> /// このインスタンスを、それと同等なUtility.Models.Entites.DtDeliveryGroup型に変換する。 /// 親エンティティとして生成するため、子エンティティの情報はもたない /// </summary> /// <returns></returns> public Utility.Models.Entites.DtDeliveryGroup ToParentModel(Type childType) { Utility.Models.Entites.DtDeliveryGroup model = ToModelCommonPart(); // 親子間の参照無限ループを避けるためにタイプチェック if (this.DtDeliveryResult.LastOrDefault()?.GetType() != childType) { model.DtDeliveryResult = this.DtDeliveryResult.Select(y => y.ToChildModel(this.GetType())).ToHashSet(); } model.DtDeliveryFile = this.DeliveryFileS?.ToParentModel(this.GetType()); model.MtDeliveryGroupStatus = this.DeliveryGroupStatusS?.ToParentModel(this.GetType()); return(model); }
/// <summary> /// このインスタンスを、それと同等なUtility.Models.Entites.DtDeliveryGroup型に変換する。 /// 各変換メソッド共通部分 /// </summary> /// <returns></returns> private Utility.Models.Entites.DtDeliveryGroup ToModelCommonPart() { Utility.Models.Entites.DtDeliveryGroup model = new Utility.Models.Entites.DtDeliveryGroup(); model.Sid = this.Sid; model.DeliveryFileSid = this.DeliveryFileSid; model.DeliveryGroupStatusSid = this.DeliveryGroupStatusSid; model.Name = this.Name; model.StartDatetime = this.StartDatetime; model.DownloadDelayTime = this.DownloadDelayTime; model.CreateDatetime = this.CreateDatetime; model.UpdateDatetime = this.UpdateDatetime; model.RowVersion = this.RowVersion; return(model); }
/// <summary> /// コンストラクタ /// </summary> /// <param name="model">Utility.Models.Entites.DtDeliveryGroupのインスタンス</param> public DtDeliveryGroup(Utility.Models.Entites.DtDeliveryGroup model) { this.Sid = model.Sid; this.DeliveryFileSid = model.DeliveryFileSid; this.DeliveryGroupStatusSid = model.DeliveryGroupStatusSid; this.Name = model.Name; this.StartDatetime = model.StartDatetime; this.DownloadDelayTime = model.DownloadDelayTime; this.CreateDatetime = model.CreateDatetime; this.UpdateDatetime = model.UpdateDatetime; this.RowVersion = model.RowVersion; this.DtDeliveryResult = model.DtDeliveryResult.Select(y => new DtDeliveryResult(y)).ToHashSet(); this.DeliveryFileS = model.DtDeliveryFile == null ? null : new DtDeliveryFile(model.DtDeliveryFile); this.DeliveryGroupStatusS = model.MtDeliveryGroupStatus == null ? null : new MtDeliveryGroupStatus(model.MtDeliveryGroupStatus); }