コード例 #1
0
ファイル: DependentMapping.cs プロジェクト: DevJulitogtu/temp
        public static Dependent MapDtoToEntity(DTOs.Dependent source)
        {
            var destination = new Dependent
            {
                Id             = source.Id,
                Active         = source.Active,
                PersonId       = source.PersonId,
                PolicyHolderId = source.PolicyHolderId
            };

            //if (source.PolicyHolder != null)
            //{
            //    destination.PolicyHolder = PolicyHolderMapping.MapDtoToEntity(source.PolicyHolder);
            //}

            if (source.Person != null)
            {
                destination.Person = PersonMapping.MapDtoToEntity(source.Person);
            }

            return(destination);
        }
コード例 #2
0
ファイル: DependentMapping.cs プロジェクト: DevJulitogtu/temp
        public static DTOs.Dependent MapEntityToDto(Dependent source)
        {
            var destination = new DTOs.Dependent
            {
                Id               = source.Id,
                Active           = source.Active,
                PersonId         = source.PersonId,
                PolicyHolderId   = source.PolicyHolderId,
                PolicyHolderName = $"{source.PolicyHolder?.Person?.LName}, {source.PolicyHolder?.Person?.FName}"
            };

            //if (source.PolicyHolder != null)
            //{
            //    destination.PolicyHolder = PolicyHolderMapping.MapEntityToDto(source.PolicyHolder);
            //}

            if (source.Person != null)
            {
                destination.Person = PersonMapping.MapEntityToDto(source.Person);
            }

            return(destination);
        }