Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

C# fix circular reference

Posted on 2016-08-04
2
Medium Priority
?
319 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 2000 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

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…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

618 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