Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to put your delegates . .

I am trying to determine the best directory structure of my application

i have:

UI
Data
Interfaces

but i dont know where to put delegates..

should there be a seperate Delegates folder or should i store the delegates in the same classes where they are being used . .

like image 408
leora Avatar asked Oct 23 '25 14:10

leora


2 Answers

If you have an common use for your delegates, you should store them on a common place, but if you only use it in your class then put it in the same class.

like image 179
JSC Avatar answered Oct 26 '25 04:10

JSC


You don't have a Classes, Structs, and Enums folder. Why have a Delegates folder?

Also, if you're using C# 3.0, you generally should be using Generic Delegates - System.Action and System.Func - instead of named delegates.

like image 36
Amy B Avatar answered Oct 26 '25 05:10

Amy B



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!