Пример #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());