Beispiel #1
0
        public static Product CreateProduct(this RetailDbContext db)
        {
            var id      = IdFactory.Next();
            var product = new Product
            {
                ProductName = $"Product {id}",
                Active      = true,
                Price       = id * 2 + 0.99m,
                SalesPrice  = id + 0.99m,
            };

            db.Add(product);

            return(product);
        }
Beispiel #2
0
        public static Store CreateStore(this RetailDbContext db)
        {
            var id    = IdFactory.Next();
            var store = new Store
            {
                Address     = $"{id} Main Street",
                City        = $"{id}ville",
                Province    = $"{id} District",
                Country     = $"{id}land",
                PostalCode  = $"{id}",
                PhoneNumber = $"({id}) {id}-{id}",
                StoreName   = $"Store {id}",
                Active      = true,
            };

            db.Add(store);

            return(store);
        }
Beispiel #3
0
        public static Customer CreateCustomer(this RetailDbContext db)
        {
            var id       = IdFactory.Next();
            var customer = new Customer
            {
                FirstName   = $"Bob{id}",
                LastName    = $"Robertson{id}",
                Address     = $"{id} Main Street",
                City        = $"{id}ville",
                Province    = $"{id} District",
                Country     = $"{id}land",
                PostalCode  = $"{id}",
                PhoneNumber = $"({id}) {id}-{id}",
                Active      = true,
                Discount    = 0.0
            };

            db.Add(customer);

            return(customer);
        }