Author Topic: Adding classes from a NuGet package to a diagram  (Read 539 times)

Frederick.Brier

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Adding classes from a NuGet package to a diagram
« on: September 05, 2018, 03:41:39 am »
How do you add a class to a diagram that is not part of your project, such as a referenced NuGet package? I want to show both inheritance and referenced classes. Thank you.

qwerty

  • EA Guru
  • *****
  • Posts: 10632
  • Karma: +234/-195
  • I'm no guru at all
    • View Profile
Re: Adding classes from a NuGet package to a diagram
« Reply #1 on: September 05, 2018, 06:50:42 am »
Honestly, I don't get what your issue is.

q.

Frederick.Brier

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Adding classes from a NuGet package to a diagram
« Reply #2 on: September 07, 2018, 10:29:57 am »
For example, I have reverse engineered the source code of my project into EA. My classes show up in the Project Browser. My project has referenced NuGet packages. I may or may not have the source code. For instance, there is a class in my project that has a reference to an NRules ISession. I create a class diagram. I drag my class into the diagram. ISession is not in my code, it is in NRules. How do I drag an ISession into a class diagram?

I just tried creating a separate diagram at the same level as my project, and attempted to import NRules source code. It gave me an error message saying my solution was already added, but then let me specify the NRules solution (.sln) file, and the namespaces to be imported. It seemed to import. Namespace folders showed up under the solution in the Project Browser pane, but no classes or interfaces appeared under the namespace folders. So I cannot drag one into the diagram. It would also be nice if I did not need the source code. I could specify a NuGet package of compiled code. It would be even nicer, if when I imported a solution, it would automatically provide the namespaces and classes from the NuGet packages referenced in the .csproj files.

Thank you for any pointers.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 9546
  • Karma: +275/-27
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Adding classes from a NuGet package to a diagram
« Reply #3 on: September 07, 2018, 03:08:57 pm »
I think you can also reverse engineer from a .dll.
Not sure which option to use though, but I guess it should be explained in the manual.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 10632
  • Karma: +234/-195
  • I'm no guru at all
    • View Profile
Re: Adding classes from a NuGet package to a diagram
« Reply #4 on: September 07, 2018, 06:01:58 pm »
Yes, you can import binary .dll. However, I'm pretty sur EA does not recognize references once you import your code. So you will have to do that manually. In similar cases I create a tmplate package for the extenal stuff to add references rather than importing the whole dll which usually contains a lot of noise.

q.