?
Solved

C# fix circular reference

Posted on 2016-08-04
2
Medium Priority
?
268 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

743 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