コード例 #1
0
        /// <summary>
        /// Converts this instance of <see cref="componentDto"/> to an instance of <see cref="component"/>.
        /// </summary>
        /// <param name="dto"><see cref="componentDto"/> to convert.</param>
        public static component ToEntity(this componentDto dto)
        {
            if (dto == null)
            {
                return(null);
            }

            var entity = new component();

            entity.v_ComponentId     = dto.v_ComponentId;
            entity.v_Name            = dto.v_Name;
            entity.i_CategoryId      = dto.i_CategoryId;
            entity.r_BasePrice       = dto.r_BasePrice;
            entity.i_DiagnosableId   = dto.i_DiagnosableId;
            entity.i_IsApprovedId    = dto.i_IsApprovedId;
            entity.i_ComponentTypeId = dto.i_ComponentTypeId;
            entity.i_UIIsVisibleId   = dto.i_UIIsVisibleId;
            entity.i_UIIndex         = dto.i_UIIndex;
            entity.i_ValidInDays     = dto.i_ValidInDays;
            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;

            dto.OnEntity(entity);

            return(entity);
        }