コード例 #1
0
 public static CodeMemberProperty WithGetSet(this CodeMemberProperty property, CodeFieldReferenceExpression backingFieldRef)
 => property.WithGet(backingFieldRef.Return())
 .WithSet(backingFieldRef.Assign(Expression.PropertySetValue));
コード例 #2
0
 public static CodeMemberProperty WithGetLazyInitialize(this CodeMemberProperty property, CodeFieldReferenceExpression fieldRef, CodeExpression init)
 => property.WithGet(
     Statement.If(fieldRef.IsNull(), Then: fieldRef.Assign(init)),
     Statement.Return(fieldRef));
コード例 #3
0
 public static CodeMemberProperty WithGet(this CodeMemberProperty property, CodeFieldReferenceExpression backingFieldRef)
 => property.WithGet(backingFieldRef.Return());