Example #1
0
        public async Task <int> AddAdminUsers(AdminUsersDto admDto, CancellationToken cancellationToken)
        {
            int ReturnId   = 0;
            var modelExist = await _repo.GetAdminUsersByUsername(admDto.LDAPUser_id, cancellationToken);

            if (modelExist == null)
            {
                var model = _mapper.Map <AdminUsers>(admDto);
                model.CreatedBy  = admDto.CreatedBy;
                model.ModifiedBy = admDto.CreatedBy;
                await _repo.AddAdminUsers(model, cancellationToken).ConfigureAwait(false);

                ReturnId = 1;
            }
            return(ReturnId);
        }