Click here to Skip to main content
15,887,485 members
Home / Discussions / C#
   

C#

 
GeneralRe: c# image pixel shrink Pin
Smithers-Jones15-Nov-11 22:23
Smithers-Jones15-Nov-11 22:23 
AnswerRe: c# image pixel shrink Pin
BillWoodruff16-Nov-11 14:54
professionalBillWoodruff16-Nov-11 14:54 
QuestionQuick way to add block comments? Pin
jclark239b915-Nov-11 6:55
jclark239b915-Nov-11 6:55 
AnswerRe: Quick way to add block comments? PinPopular
OriginalGriff15-Nov-11 9:37
mveOriginalGriff15-Nov-11 9:37 
GeneralRe: Quick way to add block comments? Pin
jclark239b915-Nov-11 10:26
jclark239b915-Nov-11 10:26 
AnswerRe: Quick way to add block comments? Pin
BobJanova16-Nov-11 3:13
BobJanova16-Nov-11 3:13 
GeneralRe: Quick way to add block comments? Pin
jclark239b918-Nov-11 5:54
jclark239b918-Nov-11 5:54 
QuestionCircular dependency between classes Pin
vinayvraman15-Nov-11 6:34
vinayvraman15-Nov-11 6:34 
Consider the following example..

C#
public class Student
{
    public string Name { get; set; }
    public IList<Course> Courses { get; set; }
}

public class Course
{
    public string Name { get; set; }
    public IList<Student> Students { get; set; }
}



In this example a circular dependency exists between Student class and Course class. The scenario arises when we are dealing with entity framework - wherein db tables are created as classes for a Student database management system.

In case of C++ we use the concept of forward declaration for telling a class 'A' that another class called 'B' exists even before defining the class 'B'.

Can anybody explain how C# compiler solves this problem of circular dependency between classes?


PS: Please avoid telling me that the classes sould be redesigned to avoid circular dependency. The question is not related to designing since the below mentioned classes are very much from day-to-day programming scenarios.
If asking a question is bad; then not knowing the answer is worse!

AnswerRe: Circular dependency between classes Pin
PIEBALDconsult15-Nov-11 6:46
mvePIEBALDconsult15-Nov-11 6:46 
AnswerRe: Circular dependency between classes Pin
Clive D. Pottinger15-Nov-11 6:54
Clive D. Pottinger15-Nov-11 6:54 
GeneralRe: Circular dependency between classes Pin
harold aptroot15-Nov-11 7:01
harold aptroot15-Nov-11 7:01 
GeneralRe: Circular dependency between classes Pin
vinayvraman15-Nov-11 7:52
vinayvraman15-Nov-11 7:52 
GeneralRe: Circular dependency between classes Pin
CDP180216-Nov-11 0:41
CDP180216-Nov-11 0:41 
QuestionFinding a custom event using reflection Pin
Clive D. Pottinger15-Nov-11 4:07
Clive D. Pottinger15-Nov-11 4:07 
AnswerRe: Finding a custom event using reflection Pin
CDP180215-Nov-11 4:19
CDP180215-Nov-11 4:19 
AnswerRe: Finding a custom event using reflection Pin
Luc Pattyn15-Nov-11 4:40
sitebuilderLuc Pattyn15-Nov-11 4:40 
GeneralRe: Finding a custom event using reflection Pin
CDP180215-Nov-11 5:02
CDP180215-Nov-11 5:02 
GeneralRe: Finding a custom event using reflection Pin
Clive D. Pottinger15-Nov-11 6:18
Clive D. Pottinger15-Nov-11 6:18 
GeneralRe: Finding a custom event using reflection Pin
Clive D. Pottinger15-Nov-11 15:30
Clive D. Pottinger15-Nov-11 15:30 
AnswerRe: Finding a custom event using reflection Pin
Luc Pattyn15-Nov-11 15:37
sitebuilderLuc Pattyn15-Nov-11 15:37 
GeneralRe: Finding a custom event using reflection Pin
CDP180215-Nov-11 22:14
CDP180215-Nov-11 22:14 
GeneralRe: Finding a custom event using reflection Pin
Wayne Gaylard15-Nov-11 22:35
professionalWayne Gaylard15-Nov-11 22:35 
GeneralRe: Finding a custom event using reflection Pin
CDP180215-Nov-11 22:54
CDP180215-Nov-11 22:54 
GeneralRe: Finding a custom event using reflection Pin
BobJanova16-Nov-11 3:03
BobJanova16-Nov-11 3:03 
QuestionAssigned AppPool resets after completion of Web Deployment Setup when using Custom Actions Pin
www.Developerof.NET15-Nov-11 2:22
www.Developerof.NET15-Nov-11 2:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.