public static void GetAccessors(this ILotAttributes lotAttributes, IAttributeNameKey attribute, out Func <decimal?> get, out Func <decimal?, decimal?> set) { var attributeNameKey = new AttributeNameKey(attribute); get = () => AttributeGetters[attributeNameKey](lotAttributes); set = v => AttributeSetters[attributeNameKey](lotAttributes, v); }
public static Func <decimal?> AttributeGet(this ILotAttributes lotAttributes, IAttributeNameKey attributeNameKey) { Func <ILotAttributes, decimal?> getter; AttributeGetters.TryGetValue(new AttributeNameKey(attributeNameKey), out getter); if (getter == null) { return(null); } return(() => getter(lotAttributes)); }