Skip to content
Discussion options

You must be logged in to vote

I don't know that there is an easy answer.

The domain objects need a reference to ApplicationContext. Requiring that all domain types be registered as a service and also requiring that they all implement a constructor to get that value would have broken literally every business class in every app for everyone who uses CSLA - that scope of breaking change seemed (and still seems) intolerable to me. Just think of the cost to update every class!

Instead, I chose to use an IUseApplicationContext interface, and inside CSLA all business classes are instantiated using a method that does:

  1. Create the instance using DI
  2. If the instance implements IUseApplicationContext then set the ApplicationContext

Replies: 5 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by kcabral817
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Chicagoan2016
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants