0

What is the meaning of this code snippet:

ConcurrentBag<UserModel> _userStore;

public Task UpdateUser(UserModel userModel) <br>
{ 
   _userStore = new ConcurrentBag<UserModel>(_userStore.Where(u => u.Email != userModel.Email)); 
   return Task.CompletedTask;
}

What does the statement { usermodel }?

Md Hasan Ibrahim
  • 1,868
  • 19
  • 27

1 Answers1

0

This initializes the ConcurrentBag with one item.

It is equivalent to:

_userStore = new ConcurrentBag(_userStore.Where(u => u.Email != userModel.Email));
_userStore.Add(userModel);
VillageTech
  • 1,968
  • 8
  • 18