예제 #1
0
        /// <summary>
        /// 添加联系人
        /// </summary>
        /// <param name="adds"></param>
        /// <returns></returns>
        private async Task AddContacts(IList <ContactAddedMsg> adds)
        {
            var employees = this._mapper.Map <IList <Employee> >(adds.Select(u => u.NewData));

            using (var db = new ServiceDbContext(_dbOptions))
            {
                await db.BulkInsertAsync(employees);

                await db.SaveChangesAsync();
            }
        }