Skip to content
Discussion options

You must be logged in to vote

Yes. For a non-nullable property whose value you guarantee during creation and loading, GetProperty(PropInfo)! is consistent with CSLA's own generated property code. The annotation on GetProperty<T> and ReadProperty<T> is T?, so the compiler cannot infer your application's invariant.

I checked the current source and a verified generator snapshot:

$ rg -n -o 'protected P\? (GetProperty|ReadProperty).*PropertyInfo<P> propertyInfo\)|get => GetProperty\(NameProperty\)!;' Source/Csla/Core/BusinessBase.cs 'Source/tests/Csla.Generator.AutoImplementProperties.CSharp.Tests/Snapshots/AutoImplementPropertiesGeneratorTests.Case03#BusinessBaseTestClass.g.verified.cs'
Source/tests/Csla.Generator.AutoIm…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by ajohnstone-ks
Comment options

You must be logged in to vote
2 replies
@ajohnstone-ks
Comment options

@StefanOssendorf
Comment options

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