Esempio n. 1
0
        public async Task <bool> AddAllAsyc(List <TBusiness> business)
        {
            try
            {
                var list = MappingHelper.ConvertAllToEntity <TEntity, TBusiness>(business);
                var res  = await _dataService.AddAll(list);

                if (res == business.Count)
                {
                    for (int index = 0; index < business.Count; index++)
                    {
                        business[index].SetId(list[index].Id);
                    }
                    return(true);
                }
            }
            catch (Exception ex)
            {
                LogOrThrow(ex);
            }
            return(false);
        }