Concise way to do a plus equals operation on a Dictionary element that might not be initialized
问题 I'm looking for an extension method or any other suggestion that can help me make this code as concise as possible. foreach( Layer lyr in this.ProgramLayers ) foreach( UWBCEvent evt in this.BcEvents.IncludedEvents ) EventGroupLayerLosses[new EventGroupIDLayerTuple(evt.EventGroupID, lyr)] += GetEL(evt.AsIfs, lyr.LimitInMillions, lyr.AttachmentInMillions); The above code has a fairly clear purpose, I'm bucketing values into groups with a compound key. However, this code will fail because the