示例#1
0
 /// <inheritdoc/>
 public override void RegisterAsKeyType(TypeRepository typeRepo)
 {
     foreach (var prop in this.Properties)
     {
         typeRepo.RegisterKeyProperty(prop.PropertyType);
     }
 }
示例#2
0
 /// <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;
 }
示例#3
0
 /// <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;
 }
示例#4
0
 /// <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;
 }
示例#5
0
 /// <inheritdoc/>
 public override void RegisterAsKeyType(TypeRepository typeRepo)
 {
     typeRepo.RegisterKeyProperty(this.InnerType);
 }
示例#6
0
 /// <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;
 }
示例#8
0
 /// <summary>
 /// Register as key type to type repository.
 /// </summary>
 /// <param name="typeRepo">The type repository.</param>
 public virtual void RegisterAsKeyType(TypeRepository typeRepo)
 {
 }
示例#9
0
 /// <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);
 }