-
-
Save Suchiman/8e331cf8c5353a65fb23873cd5b2114f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.ComponentModel.DataAnnotations; | |
| namespace WarehouseBuilder.Common.API | |
| { | |
| public class BuildComponent | |
| { | |
| public virtual long Id { get; set; } | |
| public virtual Warehouse Warehouse { get; set; } | |
| public virtual int Order { get; set; } | |
| // User editable | |
| public virtual String DisplayName { get; set; } | |
| public virtual bool Enabled { get; set; } | |
| public virtual String BatchFile { get; set; } | |
| public virtual int MaxBuildMinutes { get; set; } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.ComponentModel.DataAnnotations; | |
| namespace WarehouseBuilder.Common.API | |
| { | |
| public class Customer | |
| { | |
| public virtual long Id { get; set; } | |
| public virtual int Order { get; set; } | |
| public virtual ICollection<Warehouse> Warehouses { get; set; } | |
| // User editable | |
| public virtual Customer Dependancy { get; set; } | |
| public virtual DateTime? RunAfter { get; set; } | |
| public virtual String DisplayName { get; set; } | |
| public virtual bool Enabled { get; set; } | |
| public virtual int Number { get; set; } | |
| public virtual String BaseDirectory { get; set; } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Data.Entity; | |
| using WarehouseBuilder.Common.API; | |
| namespace WarehouseBuilder.Common | |
| { | |
| public class DatabaseContext : DbContext | |
| { | |
| public DatabaseContext() : base("Default") | |
| { | |
| } | |
| public DbSet<Customer> Customers { get; set; } | |
| public DbSet<Warehouse> Warehouses { get; set; } | |
| public DbSet<BuildComponent> BuildComponents { get; set; } | |
| protected override void OnModelCreating(DbModelBuilder modelBuilder) | |
| { | |
| modelBuilder.Entity<Warehouse>().HasRequired(g => g.Customer).WithMany(g => g.Warehouses); | |
| modelBuilder.Entity<BuildComponent>().HasOptional(w => w.Warehouse).WithMany(w => w.Components); | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.ComponentModel.DataAnnotations; | |
| namespace WarehouseBuilder.Common.API | |
| { | |
| public class Warehouse | |
| { | |
| public virtual long Id { get; set; } | |
| public virtual Customer Customer { get; set; } | |
| public virtual ICollection<BuildComponent> Components { get; set; } | |
| public virtual int Order { get; set; } | |
| // User editable | |
| public virtual String DisplayName { get; set; } | |
| public virtual bool Enabled { get; set; } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment