Solved

C# fix circular reference

Posted on 2016-08-04
2
73 Views
Last Modified: 2016-08-04
I have an app that I'm working  on. Structure is as below

MyApp.sln
--ProjA
   --Class1
   --Class2
   --Enum1  (ReportType)
--ProjB
  --Class3 (Has method "MyMethod")
  --Class4

So, ProjA has references to ProjB.

Lets say in Class2 I'm calling Class3. Want to pass the Enum1 value in  Class3.

So I'm calling MyMethod(ReportType.Static);

In Class3 when I type MyMethod(ReportType reportType)
I receive an error  because  it can't  find "ReportType". If I try to add the reference by right  clicking on  reference and adding by selecting project and selecting "ProjA" I  receive an error indicating a circular reference and I understand why.  

Any idea how to pass the enum to  Class3?
0
Comment
Question by:CipherIS
2 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 41743592
Move the definition of the enum to ProjB. The enum is obviously a dependency, so it should be in the independent class.
0
 
LVL 1

Author Comment

by:CipherIS
ID: 41743602
Thanks Kaufmed.  That works.  I was trying to  keep all the models in one spot. Oh well.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now