Ejemplo n.º 1
0
        public TableCustomer(Alias alias) : base("dbo", "Customer", alias)
        {
            this.CustomerId = this.CreateInt32Column(nameof(this.CustomerId), ColumnMeta.PrimaryKey().Identity());
            this.UserId     = this.CreateNullableInt32Column(nameof(this.UserId), ColumnMeta.ForeignKey <TableUser>(u => u.UserId));
            this.CompanyId  = this.CreateNullableInt32Column(nameof(this.CompanyId), ColumnMeta.ForeignKey <TableCompany>(u => u.CompanyId));

            //Indexes
            this.AddUniqueIndex(this.UserId, this.CompanyId);
            this.AddUniqueIndex(this.CompanyId, this.UserId);
        }
Ejemplo n.º 2
0
 public Customer(Alias alias) : base("dbo", nameof(Customer), alias)
 {
     this.CustomerId       = this.CreateInt32Column(nameof(CustomerId), ColumnMeta.PrimaryKey().Identity());
     this.UserId           = this.CreateNullableInt32Column(nameof(UserId), ColumnMeta.ForeignKey <User>(u => u.UserId));
     this.OrganizationIdId = this.CreateNullableInt32Column(nameof(OrganizationIdId), ColumnMeta.ForeignKey <Organization>(u => u.OrganizationId));
 }
Ejemplo n.º 3
0
 public TNext Set(NullableInt32TableColumn column, int?value)
 {
     return(this.SetGeneric(column, SqQueryBuilder.Literal(value)));
 }