Ejemplo n.º 1
0
        /// <summary>
        /// Converts this instance of <see cref="protocolcomponentDto"/> to an instance of <see cref="protocolcomponent"/>.
        /// </summary>
        /// <param name="dto"><see cref="protocolcomponentDto"/> to convert.</param>
        public static protocolcomponent ToEntity(this protocolcomponentDto dto)
        {
            if (dto == null)
            {
                return(null);
            }

            var entity = new protocolcomponent();

            entity.v_ProtocolComponentId = dto.v_ProtocolComponentId;
            entity.v_ProtocolId          = dto.v_ProtocolId;
            entity.v_ComponentId         = dto.v_ComponentId;
            entity.r_Price            = dto.r_Price;
            entity.i_OperatorId       = dto.i_OperatorId;
            entity.i_Age              = dto.i_Age;
            entity.i_GenderId         = dto.i_GenderId;
            entity.i_IsConditionalId  = dto.i_IsConditionalId;
            entity.i_IsDeleted        = dto.i_IsDeleted;
            entity.i_InsertUserId     = dto.i_InsertUserId;
            entity.d_InsertDate       = dto.d_InsertDate;
            entity.i_UpdateUserId     = dto.i_UpdateUserId;
            entity.d_UpdateDate       = dto.d_UpdateDate;
            entity.i_IsConditionalIMC = dto.i_IsConditionalIMC;
            entity.r_Imc              = dto.r_Imc;

            dto.OnEntity(entity);

            return(entity);
        }