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