Adding Authorization Rule to a 'unmanaged' read-only property?

Adding Authorization Rule to a 'unmanaged' read-only property?

Old forum URL: forums.lhotka.net/forums/t/11771.aspx


alainrodriguez posted on Tuesday, January 08, 2013

First, I have a readonly property which is basically a formula, that depends on two 'managed' properties. One of these managed properties have an Authorization Rule while the other does not.
How can I add an authorization rule to this read-only property? What is the recommended mechanism?

Thanks!

Ex:
    public static readonly PropertyInfo<double> SalesCostsProperty = RegisterProperty<double>(c => c.SalesCosts, "Sales Costs"RelationshipTypes.PrivateField);
     public double SalesCosts
    {
      get { return GetProperty(SalesCostsProperty, _salesCosts); }
      set { SetProperty(SalesCostsProperty, ref _salesCosts, value); }
    }
    public static readonly PropertyInfo<decimal> ReconciledProFormaNOIProperty = RegisterProperty<decimal>(c => c.ReconciledProFormaNOI, "Reconciled Pro Forma NOI", RelationshipTypes.PrivateField);
    public decimal ReconciledProFormaNOI
    {
      get { return GetProperty(ReconciledProFormaNOIProperty, _reconciledProFormaNOI); }
      set { SetProperty(ReconciledProFormaNOIProperty, ref _reconciledProFormaNOI, value); }
    }
  
  ///// HOW DO I ADD AN AUTHORIZATION RULE FOR THIS ONE???????????  
 public decimal GoingInCapRate

 

    {
      get { return ReconciledProFormaNOI * SalesCosts; }
    }

 

alainrodriguez replied on Tuesday, January 08, 2013

LOL.. nevermind...  since one of them is already 'managed', adding the authorization rule to that one will trigger the rule on the readonly property... so i guess it is all good.. :) ....

 

 

Copyright (c) Marimer LLC