Click or drag to resize

ControllerStandardDataItemClassAppModule Property

Requirement for data handling

Namespace:  SOWIWin.Helper
Assembly:  SOWIWin.Helper (in SOWIWin.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 (this.Session.IsAuthenticated)
       {
           return (SOWIApp.Foundation.IAppController<SOWIData.App.Activity>)
               new SOWIApp.Basic.Activity(this.Session.Token.ToGUID());
       }
       return null;
   }
}
If need more methods from App then must create full App
private SOWIApp.Administrator.Address AppAddress
{
   get
   {
       if (this.Session.IsAuthenticated)
       {
           return new SOWIApp.Administrator.Address(this.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 (this.Session.IsAuthenticated)
       {
           if (_AppUser == null)
           {
               _AppUser = new SOWIApp.Administrator.User(this.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