Exemplo n.º 1
0
        /// <summary>
        /// このインスタンスを、それと同等なUtility.Models.Entites.DtParentChildConnect型に変換する。
        /// 親エンティティとして生成するため、子エンティティの情報はもたない
        /// </summary>
        /// <returns></returns>
        public Utility.Models.Entites.DtParentChildConnect ToParentModel(Type childType)
        {
            Utility.Models.Entites.DtParentChildConnect model = ToModelCommonPart();
            model.DtDevice  = this.ChildDeviceS?.ToParentModel(this.GetType());
            model.DtDevice1 = this.ParentDeviceS?.ToParentModel(this.GetType());

            return(model);
        }
Exemplo n.º 2
0
        /// <summary>
        /// このインスタンスを、それと同等なUtility.Models.Entites.DtParentChildConnect型に変換する。
        /// 子エンティティとして生成するため、親エンティティの情報をもたない
        /// </summary>
        /// <returns></returns>
        public Utility.Models.Entites.DtParentChildConnect ToChildModel(Type parentType)
        {
            Utility.Models.Entites.DtParentChildConnect model = ToModelCommonPart();
            // 親子間の参照無限ループを避けるためにタイプチェック
            if (this.ChildDeviceS?.GetType() != parentType)
            {
                model.DtDevice = this.ChildDeviceS?.ToParentModel(this.GetType());
            }
            if (this.ParentDeviceS?.GetType() != parentType)
            {
                model.DtDevice1 = this.ParentDeviceS?.ToParentModel(this.GetType());
            }

            return(model);
        }
Exemplo n.º 3
0
 /// <summary>
 /// このインスタンスを、それと同等なUtility.Models.Entites.DtParentChildConnect型に変換する。
 /// 各変換メソッド共通部分
 /// </summary>
 /// <returns></returns>
 private Utility.Models.Entites.DtParentChildConnect ToModelCommonPart()
 {
     Utility.Models.Entites.DtParentChildConnect model = new Utility.Models.Entites.DtParentChildConnect();
     model.Sid                       = this.Sid;
     model.ParentDeviceSid           = this.ParentDeviceSid;
     model.ChildDeviceSid            = this.ChildDeviceSid;
     model.ParentResult              = this.ParentResult;
     model.ParentConfirmDatetime     = this.ParentConfirmDatetime;
     model.ParentLastConnectDatetime = this.ParentLastConnectDatetime;
     model.ChildResult               = this.ChildResult;
     model.ChildConfirmDatetime      = this.ChildConfirmDatetime;
     model.ChildLastConnectDatetime  = this.ChildLastConnectDatetime;
     model.CreateDatetime            = this.CreateDatetime;
     model.UpdateDatetime            = this.UpdateDatetime;
     return(model);
 }
Exemplo n.º 4
0
 /// <summary>
 /// コンストラクタ
 /// </summary>
 /// <param name="model">Utility.Models.Entites.DtParentChildConnectのインスタンス</param>
 public DtParentChildConnect(Utility.Models.Entites.DtParentChildConnect model)
 {
     this.Sid                       = model.Sid;
     this.ParentDeviceSid           = model.ParentDeviceSid;
     this.ChildDeviceSid            = model.ChildDeviceSid;
     this.ParentResult              = model.ParentResult;
     this.ParentConfirmDatetime     = model.ParentConfirmDatetime;
     this.ParentLastConnectDatetime = model.ParentLastConnectDatetime;
     this.ChildResult               = model.ChildResult;
     this.ChildConfirmDatetime      = model.ChildConfirmDatetime;
     this.ChildLastConnectDatetime  = model.ChildLastConnectDatetime;
     this.CreateDatetime            = model.CreateDatetime;
     this.UpdateDatetime            = model.UpdateDatetime;
     this.ChildDeviceS              = model.DtDevice == null ?
                                      null :
                                      new DtDevice(model.DtDevice);
     this.ParentDeviceS = model.DtDevice1 == null ?
                          null :
                          new DtDevice(model.DtDevice1);
 }