Can I evaluate an expression in a way to determine and possibly set a property that is null?
- 阅读更多 关于 Can I evaluate an expression in a way to determine and possibly set a property that is null?
问题 I have a service that takes an object and based on the properties within will perform different actions; with this any of these properties can be null, meaning don't perform this action. I am trying to create a very simple to use API to do this in cases where some properties can be multiple levels deep, here is an example of the current implementation service.PerformActions(DataFactory.GetNewData<ActionsInfo> ( data => data.SomeParent = DataFactory.GetNewData<SomeParentInfo>(), data => data