Click or drag to resize

ControllerStandardDataItemClassAppModule Property

Requirement for data handling

Namespace:  SOWIWeb.Helper
Assembly:  SOWIWeb.Helper (in SOWIWeb.Helper.dll) Version: 19.1.23.1 (19.1.23.622)
Syntax
protected abstract IAppController<DataItemClass> AppModule { get; }

Property Value

Type: IAppControllerDataItemClass
Examples
Gives an simple App for data handling e.g. module Activity
protected override SOWIApp.Foundation.IAppController<SOWIData.App.Activity> AppModule
{
   get
   {
       if (SOWIWeb.Helper.Session.IsAuthenticated)
       {
           return (SOWIApp.Foundation.IAppController<SOWIData.App.Activity>)
               new SOWIApp.Basic.Activity(SOWIWeb.Helper.Session.Token.ToGUID());
       }
       return null;
   }
}
If need more methods from App then must create full App
private SOWIApp.Administrator.Address AppAddress
{
   get
   {
       if (SOWIWeb.Helper.Session.IsAuthenticated)
       {
           return new SOWIApp.Administrator.Address(SOWIWeb.Helper.Session.Token.ToGUID());
       }
       return null;
   }
}

protected override SOWIApp.Foundation.IAppController<SOWIData.Management.Address> AppModule
{ get { return (SOWIApp.Foundation.IAppController<SOWIData.Management.Address>)this.AppAddress; } }
Performance optimize
private SOWIApp.Administrator.User _AppUser;

private SOWIApp.Administrator.User AppUser
{
   get
   {
       if (SOWIWeb.Helper.Session.IsAuthenticated)
       {
           if (_AppUser == null)
           {
               _AppUser = new SOWIApp.Administrator.User(SOWIWeb.Helper.Session.Token.ToGUID());
           }
           return _AppUser;
       }
       return null;
   }
}

protected override SOWIApp.Foundation.IAppController<SOWIData.Management.User> AppModule
{ get { return (SOWIApp.Foundation.IAppController<SOWIData.Management.User>)this.AppUser; } }
See Also