/// <inheritdoc/> public override void RegisterAsKeyType(TypeRepository typeRepo) { foreach (var prop in this.Properties) { typeRepo.RegisterKeyProperty(prop.PropertyType); } }
/// <summary> /// Initialzie an instance of <see cref="DynamicProxyStub"/>. /// </summary> /// <param name="typeRepo">The type repository.</param> /// <param name="dbClient">The database client.</param> /// <param name="dbRecordBuilder">The database record builder.</param> internal DynamicProxyStub( TypeRepository typeRepo, IDatabase dbClient, IDbRecordBuilder dbRecordBuilder) { this.typeRepo = typeRepo; this.dbClient = dbClient; this.dbRecordBuilder = dbRecordBuilder; }
/// <summary> /// Initialize an instance of <see cref="DynamicProxyGenerator"/>. /// </summary> /// <param name="typeRepo">The type repository.</param> /// <param name="dynamicProxyStub">The dynamic proxy stub.</param> /// <param name="dbClient">The database client.</param> /// <param name="isReadonly">True if the proxy from the getter is readonly.</param> public DynamicProxyGenerator( TypeRepository typeRepo, DynamicProxyStub dynamicProxyStub, IDatabase dbClient, bool isReadonly = false) { this.typeRepo = typeRepo; this.dynamicProxyStub = dynamicProxyStub; this.dbClient = dbClient; this.Readonly = isReadonly; }
/// <summary> /// Initialize an instance of <see cref="DbContext"/>. /// </summary> /// <param name="typeRepository">The type repository.</param> /// <param name="dbRecordBuilder">The database record builder.</param> /// <param name="proxyGenerator">The proxy generator.</param> /// <param name="dbClient">The database client.</param> internal DbContext( TypeRepository typeRepository, DbRecordBuilder dbRecordBuilder, DynamicProxyGenerator proxyGenerator, IDatabase dbClient) { this.typeRepository = typeRepository; this.dbRecordBuilder = dbRecordBuilder; this.proxyGenerator = proxyGenerator; this.dbClient = dbClient; }
/// <inheritdoc/> public override void RegisterAsKeyType(TypeRepository typeRepo) { typeRepo.RegisterKeyProperty(this.InnerType); }
/// <inheritdoc/> public override void RegisterSubType(TypeRepository typeRepo) { typeRepo.Register(this.InnerType); }
/// <summary> /// Initialize an instance of <see cref="DbRecordBuilder"/>. /// </summary> /// <param name="typeRepo">The type repository.</param> public DbRecordBuilder(TypeRepository typeRepo) { this.typeRepo = typeRepo; }
/// <summary> /// Register as key type to type repository. /// </summary> /// <param name="typeRepo">The type repository.</param> public virtual void RegisterAsKeyType(TypeRepository typeRepo) { }
/// <summary> /// Register sub-types to type repository. /// </summary> /// <param name="typeRepo">The type repository.</param> public virtual void RegisterSubType(TypeRepository typeRepo) { }
/// <inheritdoc/> public override void RegisterAsKeyType(TypeRepository typeRepo) { throw new ArgumentException("Key property cannot be an entity type or include an entity type."); }
/// <inheritdoc/> public override void RegisterSubType(TypeRepository typeRepo) { typeRepo.RegisterKeyProperty(this.KeyProperty.PropertyType); base.RegisterSubType(typeRepo); }