Example #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);
        }
Example #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();
        }
Example #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();
        }
Example #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);
 }