Beispiel #1
0
        /// <summary>
        /// Invoked when <see cref="ToDTO"/> operation is about to return.
        /// </summary>
        /// <param name="dto"><see cref="ProviderDTO"/> converted from <see cref="Provider"/>.</param>
partial         static void OnDTO(this Provider entity, ProviderDTO dto);
Beispiel #2
0
        /// <summary>
        /// Converts this instance of <see cref="Provider"/> to an instance of <see cref="ProviderDTO"/>.
        /// </summary>
        /// <param name="entity"><see cref="Provider"/> to convert.</param>
        public static ProviderDTO ToDTO(this Provider entity)
        {
            if (entity == null) return null;

            var dto = new ProviderDTO();

            dto.ProviderId = entity.ProviderId;
            dto.Name = entity.Name;
            dto.Category = entity.Category;
            dto.Type = entity.Type;
            dto.Path = entity.Path;
            dto.Config = entity.Config;
            dto.Description = entity.Description;
            dto.IsActive = entity.IsActive;

            entity.OnDTO(dto);

            return dto;
        }