public MemContext() { var account = new Account { Id = 1, Name = "My Test Account", Paid = true, PaidUtc = new DateTime(2016, 1, 1), AccountType = AccountType.Gold }; Accounts.Add(account); var user = new User { Id = 1, Name = "Joe User", AccountId = 1, Account = account, Active = true }; Users.Add(user); account.Users = new List <User> { user }; var account2 = new Account { Id = 2, Name = "Another Test Account", Paid = false, AccountType = AccountType.Silver }; Accounts.Add(account2); var user2 = new User { Id = 2, Name = "Late Paying User", AccountId = 2, Account = account2 }; Users.Add(user2); MutateMes.Add(new MutateMe { Id = 1, Value = 0, }); account2.Users = new List <User> { user2 }; var human = new Human { Id = 1, Name = "Han Solo", Height = 5.6430448 }; Heros.Add(human); var stormtrooper = new Stormtrooper { Id = 2, Name = "FN-2187", Height = 4.9, Specialization = "Imperial Snowtrooper" }; Heros.Add(stormtrooper); var droid = new Droid { Id = 3, Name = "R2-D2", PrimaryFunction = "Astromech" }; Heros.Add(droid); var vehicle = new Vehicle { Id = 1, Name = "Millennium falcon", OwnerId = human.Id }; Vehicles.Add(vehicle); human.Vehicles = new List <Vehicle> { vehicle }; var vehicle2 = new Vehicle { Id = 2, Name = "Speeder bike", OwnerId = stormtrooper.Id }; Vehicles.Add(vehicle2); stormtrooper.Vehicles = new List <Vehicle> { vehicle2 }; }
public static ICollection <ICharacter> CreateData() { var luke = new Human { Id = "1000", Name = "Luke Skywalker", AppearsIn = new List <EpisodeEnum> { EpisodeEnum.NEWHOPE, EpisodeEnum.EMPIRE, EpisodeEnum.JEDI }, HomePlanet = "Tatooine" }; var vader = new Human { Id = "1001", Name = "Darth Vader", AppearsIn = new List <EpisodeEnum> { EpisodeEnum.NEWHOPE, EpisodeEnum.EMPIRE, EpisodeEnum.JEDI }, HomePlanet = "Tatooine" }; var han = new Human { Id = "1002", Name = "Han Solo", AppearsIn = new List <EpisodeEnum> { EpisodeEnum.NEWHOPE, EpisodeEnum.EMPIRE, EpisodeEnum.JEDI } }; var leia = new Human { Id = "1003", Name = "Leia Organa", AppearsIn = new List <EpisodeEnum> { EpisodeEnum.NEWHOPE, EpisodeEnum.EMPIRE, EpisodeEnum.JEDI }, HomePlanet = "Alderaan" }; var tarkin = new Human { Id = "1004", Name = "Wilhuff Tarkin", AppearsIn = new List <EpisodeEnum> { EpisodeEnum.NEWHOPE } }; var threepio = new Droid { Id = "2000", Name = "C-3PO", AppearsIn = new List <EpisodeEnum> { EpisodeEnum.NEWHOPE, EpisodeEnum.EMPIRE, EpisodeEnum.JEDI }, PrimaryFunction = "Protocol" }; var artoo = new Droid { Id = "2001", Name = "R2-D2", AppearsIn = new List <EpisodeEnum> { EpisodeEnum.NEWHOPE, EpisodeEnum.EMPIRE, EpisodeEnum.JEDI }, PrimaryFunction = "Astromech" }; luke.Friends = new List <ICharacter> { han, leia, threepio, artoo }; vader.Friends = new List <ICharacter> { tarkin }; han.Friends = new List <ICharacter> { luke, leia, artoo }; leia.Friends = new List <ICharacter> { luke, han, threepio, artoo }; tarkin.Friends = new List <ICharacter> { vader }; threepio.Friends = new List <ICharacter> { luke, han, leia, artoo }; artoo.Friends = new List <ICharacter> { luke, han, leia }; return(new List <ICharacter> { luke, vader, han, leia, tarkin, threepio, artoo }); }
public MemContext() { var account = new Account { Id = 1, Name = "My Test Account", Paid = true, PaidUtc = new DateTime(2016, 1, 1), }; Accounts.Add(account); var user = new User { Id = 1, Name = "Joe User", AccountId = 1, Account = account, Active = true }; Users.Add(user); account.Users = new List<User> { user }; var account2 = new Account { Id = 2, Name = "Another Test Account", Paid = false }; Accounts.Add(account2); var user2 = new User { Id = 2, Name = "Late Paying User", AccountId = 2, Account = account2 }; Users.Add(user2); MutateMes.Add(new MutateMe { Id = 1, Value = 0, }); account2.Users = new List<User> { user2 }; var human = new Human { Id = 1, Name = "Han Solo", Height = 5.6430448 }; Heros.Add(human); var stormtrooper = new Stormtrooper { Id = 2, Name = "FN-2187", Height = 4.9, Specialization = "Imperial Snowtrooper" }; Heros.Add(stormtrooper); var droid = new Droid { Id = 3, Name = "R2-D2", PrimaryFunction = "Astromech" }; Heros.Add(droid); var vehicle = new Vehicle { Id = 1, Name = "Millennium falcon", OwnerId = human.Id }; Vehicles.Add(vehicle); human.Vehicles = new List<Vehicle> { vehicle }; var vehicle2 = new Vehicle { Id = 2, Name = "Speeder bike", OwnerId = stormtrooper.Id }; Vehicles.Add(vehicle2); stormtrooper.Vehicles = new List<Vehicle> { vehicle2 }; }