Exemplo n.º 1
0
        /// <summary>
        /// Method delegate to service update shop
        /// <summary>
        /// <param name="shopId">int</param>
        /// <param name="shop">Shop</param>
        /// <returns>void</returns>
        public async Task UpdateShop(int shopId, ShopEntity shop)
        {
            var currentShop = await shopRepository.SingleShopNoTrackAsync(shopId);

            shop.Id        = shopId;
            shop.CreatedAt = currentShop.CreatedAt;
            shop.UpdatedAt = DateTime.Now;
            await shopRepository.UpdateShopAsync(shop);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Method update shop
        /// <summary>
        /// <param name="shop">Shop</param>
        /// <returns>void</returns>
        public async Task UpdateShopAsync(ShopEntity shop)
        {
            await Task.Run(() => dbContext.Shops.Update(shop));

            await SaveAsync();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Method create shop
        /// <summary>
        /// <param name="shop">Shop</param>
        /// <returns>void</returns>
        public async Task CreateShopAsync(ShopEntity shop)
        {
            await dbContext.Shops.AddAsync(shop);

            await SaveAsync();
        }
Exemplo n.º 4
0
 /// <summary>
 /// Method delegate to service create shop
 /// <summary>
 /// <param name="shop">Shop</param>
 /// <returns>void</returns>
 public async Task CreateShop(ShopEntity shop)
 {
     shop.CreatedAt = DateTime.Now;
     shop.UpdatedAt = DateTime.Now;
     await shopRepository.CreateShopAsync(shop);
 }