예제 #1
0
        /// <summary>
        /// Updates the asynchronous.
        /// </summary>
        /// <param name="area">The category.</param>
        /// <returns>
        /// UpdateAsync
        /// </returns>
        /// <exception cref="ArgumentNullException">category</exception>
        public async Task <int> UpdateAsync(PackageAreaModel area)
        {
            if (area == null)
            {
                throw new ArgumentNullException("city");
            }

            return(await this.areaRepository.UpdateAsync(area));
        }
예제 #2
0
        /// <summary>
        /// Inserts the asynchronous.
        /// </summary>
        /// <param name="areaModel">The category.</param>
        /// <returns>
        /// InsertAsync
        /// </returns>
        /// <exception cref="ArgumentNullException">category</exception>
        public async Task <int> InsertAsync(PackageAreaModel areaModel)
        {
            if (areaModel == null)
            {
                throw new ArgumentNullException("category");
            }

            try
            {
                return(await this.areaRepository.InsertAsync(areaModel));
            }
            catch (Exception ex)
            {
                var msg = ex.ToString();
                return(0);
            }
        }