public DbInfoModule(EntityArea area) : base(area, "DbInfo", version: CurrentVersion) { RegisterEntities(typeof(IDbInfo), typeof(IDbModuleInfo)); this.RegisterSize("AppVersion", 20); App.RegisterService<IDbInfoService>(this); }
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); }
/// <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); }
/// <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; } }
public string GetSchema(EntityArea area) { string schema; if (SchemaMappings.TryGetValue(area.Name, out schema)) return schema; return area.Name; }
public TemplateModule(EntityArea area, TemplateModuleSettings settings = null) : base(area, "TemplateModule", version: CurrentVersion) { _settings = settings ?? new TemplateModuleSettings(); RegisterEntities(typeof(ITextTemplate)); App.RegisterService<ITemplateTransformService>(this); }
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); }
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; }
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>(); }
/// <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); }
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); } }
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(); }
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)); }
public EntityModuleV1(EntityArea area) : base(area, "TestModule", version: new Version("1.0.0.0")) { RegisterEntities(typeof(IParentEntity), typeof(IChildEntity), typeof(IEntityToDelete), typeof(ITable)); }
public NotificationLogModule(EntityArea area) : base(area, "NotificationLog", version: CurrentVersion) { RegisterEntities(typeof(INotificationLog)); App.RegisterService<INotificationLogService>(this); }
public DataHistoryModule(EntityArea area) : base(area, "DataHistory", version: CurrentVersion) { this.RegisterEntities(typeof(IDataHistory)); App.RegisterService<IDataHistoryService>(this); }
public IncidentLogModule(EntityArea area, string name = "IncidentLog") : base(area, name, version: CurrentVersion) { RegisterEntities(typeof(IIncidentLog), typeof(IIncidentAlert)); App.RegisterService<IIncidentLogService>(this); }
public EncryptedDataModule(EntityArea area) : base(area, "EncryptedData", version: CurrentVersion) { RegisterEntities(typeof(IEncryptedData)); App.RegisterService<IEncryptionService>(this); }
public SequenceTestModule(EntityArea area) : base(area, "SequenceTestModule") { RegisterEntities(typeof(ICar), typeof(IPerson)); this.RegisterSequence(IntSequence, typeof(int)); this.RegisterSequence(LongSequence, typeof(long)); }
public DbSchemaInfo(DbModel model, EntityArea area, string schema) : base(model, schema, DbObjectType.Schema, area) { Area = area; base.GlobalName = Schema; }
public EventLogModule(EntityArea area) : base(area, "EventLog", version: CurrentVersion) { this.RegisterEntities(typeof(IEvent), typeof(IEventParameter)); App.RegisterService<IEventLogService>(this); }
public LockTestModule(EntityArea area) : base(area, "LockTestModule", version: new Version("1.0.0.0")) { RegisterEntities(typeof(IDoc), typeof(IDocDetail)); }
public ErrorLogModule(EntityArea area) : base(area, "ErrorLog", "Error Logging Module.", version: CurrentVersion) { RegisterEntities(typeof(IErrorLog)); App.RegisterService<IErrorLogService>(this); }
private bool IsActive(EntityArea area) { return true; /* if(!_driver.Supports(DbFeatures.Schemas)) return true; return _dbModel.ContainsSchema(area.Name); */ }
public LoginLogModule(EntityArea area, string name = "LoginLog", string description = null) : base(area, name, description, version: CurrentVersion) { RegisterEntities(typeof(ILoginLog)); App.RegisterService<ILoginLogService>(this); }
public WebCallLogModule(EntityArea area) : base(area, "WebLog", version: CurrentVersion) { RegisterEntities(typeof(IWebCallLog)); App.RegisterService<IWebCallLogService>(this); }