/// <summary> /// Converts this instance of <see cref="TypeCode"/> to an instance of <see cref="TypeCodeDTO"/>. /// </summary> /// <param name="entity"><see cref="TypeCode"/> to convert.</param> public static TypeCodeDTO ToDTO(this JobsInABA.DAL.Entities.TypeCode entity) { if (entity == null) { return(null); } var dto = new TypeCodeDTO(); dto.TypeCodeID = entity.TypeCodeID; dto.Name = entity.Name; dto.Code = entity.Code; dto.Description = entity.Description; dto.ClassTypeID = entity.ClassTypeID; dto.ParentTypeCodeID = entity.ParentTypeCodeID; entity.OnDTO(dto); return(dto); }