Esempio n. 1
0
 public DbInfoModule(EntityArea area)
     : base(area, "DbInfo", version: CurrentVersion)
 {
     RegisterEntities(typeof(IDbInfo), typeof(IDbModuleInfo));
       this.RegisterSize("AppVersion", 20);
       App.RegisterService<IDbInfoService>(this);
 }
Esempio n. 2
0
 public OperationLogModule(EntityArea area, LogLevel logLevel = LogLevel.Details)
     : base(area, "OperationLog", "Operation log module.", version: CurrentVersion)
 {
     this.LogLevel = logLevel;
       RegisterEntities(typeof(IOperationLog));
       App.RegisterService<IOperationLogService>(this);
 }
Esempio n. 3
0
        /// <summary>Adds an area (logical equivalent of database schema like 'dbo') to the data model.</summary>
        /// <param name="areaName">Area name. It is default for schema name, unless it is mapped to different schema.</param>
        /// <returns>A new area instance.</returns>
        /// <remarks>Before you can create modules and register entities for your entity app,
        /// you must create at least one area. </remarks>
        public EntityArea AddArea(string areaName)
        {
            var area = new EntityArea(this, areaName);

            _areas.Add(area);
            return(area);
        }
Esempio n. 4
0
 /// <summary>Moves entities (types) from their original areas to the target Area. </summary>
 /// <param name="toArea">Target area.</param>
 /// <param name="entityTypes">Entity types.</param>
 public void MoveTo(EntityArea toArea, params Type[] entityTypes)
 {
     foreach (var ent in entityTypes)
     {
         MovedEntities[ent] = toArea;
     }
 }
Esempio n. 5
0
 public string GetSchema(EntityArea area)
 {
     string schema;
       if (SchemaMappings.TryGetValue(area.Name, out schema))
     return schema;
       return area.Name;
 }
Esempio n. 6
0
 public TemplateModule(EntityArea area, TemplateModuleSettings settings = null)
     : base(area, "TemplateModule", version: CurrentVersion)
 {
     _settings = settings ?? new TemplateModuleSettings();
       RegisterEntities(typeof(ITextTemplate));
       App.RegisterService<ITemplateTransformService>(this);
 }
Esempio n. 7
0
 public TransactionLogModule(EntityArea area, TransactionLogSettings settings = null)
     : base(area, "TransactionLog", version: CurrentVersion)
 {
     Settings = settings ?? new TransactionLogSettings();
       App.RegisterConfig(Settings);
       RegisterEntities(typeof(ITransactionLog));
       App.RegisterService<ITransactionLogService>(this);
 }
Esempio n. 8
0
 public DbUpgradeLogModule(EntityArea area, string name = "DbUpgradeLog")
     : base(area, name, version: CurrentVersion)
 {
     RegisterEntities(EntityTypes);
       App.RegisterService<IDbUpgradeLogService>(this);
       var dsService = App.DataAccess;
       dsService.Events.DataSourceStatusChanging += Events_DataSourceStatusChanging;
 }
Esempio n. 9
0
 public OAuthClientModule(EntityArea area, OAuthClientSettings settings = null)
     : base(area, "OAuthClient", version: CurrentVersion)
 {
     Settings = settings ?? new OAuthClientSettings();
       this.App.RegisterConfig(this.Settings);
       RegisterEntities(typeof(IOAuthRemoteServer), typeof(IOAuthRemoteServerAccount), typeof(IOAuthAccessToken),
       typeof(IOAuthClientFlow), typeof(IOAuthOpenIdToken), typeof(IOAuthExternalUser));
       App.RegisterService<IOAuthClientService>(this);
       Requires<EncryptedData.EncryptedDataModule>();
 }
Esempio n. 10
0
 /// <summary>Constructs a new instance of the <c>EntityModule</c> class. </summary>
 /// <param name="area">Primary entity area to register module entities.</param>
 /// <param name="name">Module name.</param>
 /// <param name="description">Optional. Module description.</param>
 /// <param name="version">Module version.</param>
 public EntityModule(EntityArea area, string name, string description = null, Version version = null)
 {
     Area = area;
     App  = Area.App;
     Util.Check(App.Status == EntityAppStatus.Created, "Module may not be added to an entity app after it is initialized.");
     Name        = name;
     Description = description;
     Version     = version ?? new Version("1.0.0.0");
     App.AddModule(this);
 }
Esempio n. 11
0
 public LoginModule(EntityArea area, LoginModuleSettings settings, string name = null)
     : base(area, name ?? "LoginModule", "Login module", version: CurrentVersion)
 {
     _settings = settings;
       App.RegisterConfig(_settings);
       //Register entities
       RegisterEntities(typeof(ILogin), typeof(ISecretQuestion), typeof(ISecretQuestionAnswer),  typeof(ITrustedDevice),
       typeof(ILoginExtraFactor), typeof(IPasswordHistory), typeof(ILoginProcess));
       //Register services
       App.RegisterService<ILoginService>(this);
       App.RegisterService<ILoginProcessService>(this);
       App.RegisterService<ILoginManagementService>(this);
       App.RegisterService<ILoginAdministrationService>(this);
       Requires<EncryptedDataModule>();
       Requires<TextTemplates.TemplateModule>();
       RegisterSize("EventType", 50);
       // Create recaptcha service if settings are there
       if (_settings.Recaptcha != null) {
     var recaptcha = new RecaptchaService(_settings.Recaptcha);
     App.RegisterService<IRecaptchaService>(recaptcha);
       }
 }
Esempio n. 12
0
        public BooksModule(EntityArea area)
            : base(area, "Books", "Books module", version: CurrentVersion)
        {
            RegisterEntities(typeof(IBook), typeof(IPublisher), typeof(IAuthor), typeof(IBookAuthor), typeof(IBookReview),
                       typeof(IUser), typeof(IBookOrder), typeof(IBookOrderLine),  typeof(ICoupon), typeof(IImage));

              //Register companion types that describe keys and indexes on entities
              RegisterCompanionTypes(
              typeof(IBookKeys), typeof(IAuthorKeys), typeof(IPublisherKeys));
              //Add extra tracking columns in book, order, coupon entities
              var tranLogExt = new TransactionLogModelExtender();
              tranLogExt.AddUpdateStampColumns(new[] { typeof(IBook), typeof(IBookOrder), typeof(IBookOrderLine), typeof(ICoupon) },
            createIdPropertyName: "CreatedIn", updateIdPropertyName: "UpdatedIn");
              App.ModelExtenders.Add(tranLogExt);
              //Set cached types
              App.CacheSettings.AddCachedTypes(CacheType.FullSet, typeof(IBook), typeof(IPublisher), typeof(IAuthor), typeof(IBookAuthor));
              App.CacheSettings.AddCachedTypes(CacheType.Sparse, typeof(IBookOrder), typeof(IBookOrderLine), typeof(IUser), typeof(IImage));
              //Register api controllers
              App.ApiConfiguration.RegisterControllerTypes(typeof(CatalogController), typeof(UserAccountController), typeof(SignupController));

              RegisterViews();
        }
Esempio n. 13
0
 public EntityModuleV2(EntityArea area)
     : base(area, "TestModule", version: new Version("1.1.0.0"))
 {
     base.RegisterEntities(typeof(IParentEntity), typeof(IChildEntityRenamed), typeof(ITable), typeof(INewTable));
     base.RegisterCompanionTypes(typeof(IParentEntityKeys));
 }
Esempio n. 14
0
 public EntityModuleV1(EntityArea area)
     : base(area, "TestModule", version: new Version("1.0.0.0"))
 {
     RegisterEntities(typeof(IParentEntity), typeof(IChildEntity), typeof(IEntityToDelete), typeof(ITable));
 }
Esempio n. 15
0
 public NotificationLogModule(EntityArea area)
     : base(area, "NotificationLog", version: CurrentVersion)
 {
     RegisterEntities(typeof(INotificationLog));
       App.RegisterService<INotificationLogService>(this);
 }
Esempio n. 16
0
 public DataHistoryModule(EntityArea area)
     : base(area, "DataHistory", version: CurrentVersion)
 {
     this.RegisterEntities(typeof(IDataHistory));
       App.RegisterService<IDataHistoryService>(this);
 }
Esempio n. 17
0
 public IncidentLogModule(EntityArea area, string name = "IncidentLog")
     : base(area, name, version: CurrentVersion)
 {
     RegisterEntities(typeof(IIncidentLog), typeof(IIncidentAlert));
       App.RegisterService<IIncidentLogService>(this);
 }
Esempio n. 18
0
 public EncryptedDataModule(EntityArea area)
     : base(area, "EncryptedData", version: CurrentVersion)
 {
     RegisterEntities(typeof(IEncryptedData));
       App.RegisterService<IEncryptionService>(this);
 }
Esempio n. 19
0
 public SequenceTestModule(EntityArea area)
     : base(area, "SequenceTestModule")
 {
     RegisterEntities(typeof(ICar), typeof(IPerson));
       this.RegisterSequence(IntSequence, typeof(int));
       this.RegisterSequence(LongSequence, typeof(long));
 }
Esempio n. 20
0
 public DbSchemaInfo(DbModel model, EntityArea area, string schema)
     : base(model, schema, DbObjectType.Schema, area)
 {
     Area = area;
       base.GlobalName = Schema;
 }
Esempio n. 21
0
 public EventLogModule(EntityArea area)
     : base(area, "EventLog", version: CurrentVersion)
 {
     this.RegisterEntities(typeof(IEvent), typeof(IEventParameter));
       App.RegisterService<IEventLogService>(this);
 }
Esempio n. 22
0
 public LockTestModule(EntityArea area)
     : base(area, "LockTestModule", version: new Version("1.0.0.0"))
 {
     RegisterEntities(typeof(IDoc), typeof(IDocDetail));
 }
Esempio n. 23
0
 public ErrorLogModule(EntityArea area)
     : base(area, "ErrorLog", "Error Logging Module.", version: CurrentVersion)
 {
     RegisterEntities(typeof(IErrorLog));
       App.RegisterService<IErrorLogService>(this);
 }
Esempio n. 24
0
 private bool IsActive(EntityArea area)
 {
     return true;
       /*
       if(!_driver.Supports(DbFeatures.Schemas))
     return true;
       return _dbModel.ContainsSchema(area.Name);
        */
 }
Esempio n. 25
0
 public LoginLogModule(EntityArea area, string name = "LoginLog", string description = null)
     : base(area, name, description, version: CurrentVersion)
 {
     RegisterEntities(typeof(ILoginLog));
       App.RegisterService<ILoginLogService>(this);
 }
Esempio n. 26
0
 public WebCallLogModule(EntityArea area)
     : base(area, "WebLog", version: CurrentVersion)
 {
     RegisterEntities(typeof(IWebCallLog));
       App.RegisterService<IWebCallLogService>(this);
 }