Exemplo n.º 1
0
        protected void AddShopMembership(UserEntityModel user, ShopEntityModel shop)
        {
            // Add Shop Membership.
            var userShop = new UserShopEntityModel
            {
                User      = user,
                Shop      = shop,
                CreatedBy = User
            };

            Context.UserShops.Add(userShop);
            Context.SaveChanges();
            Trace.WriteLine($"Added Shop Membership -> {user.UserName} => {shop.Name}");
        }
Exemplo n.º 2
0
        protected ShopEntityModel AddShop(string shopName, AccountEntityModel account)
        {
            var shop = new ShopEntityModel
            {
                Name       = shopName,
                StateId    = 1,
                CurrencyId = 1,
                Account    = account,
                CreatedBy  = User
            };

            Context.Shops.Add(shop);
            Context.SaveChanges();
            Trace.WriteLine($"Added Test Shop -> {shop.Name}");
            return(Context.Shops.FirstOrDefault(s => s.Name == shopName));
        }