Chapter 3: User-Facing Backend -> Update with Lambda Expression

Hi,

In the following code :

`await _sessionsCollection.UpdateOneAsync(u => u.UserId == user.Email,
Builders<Session>.Update.Set(u => u.UserId, user.Email).Set(s => s.Jwt, user.AuthToken),
new UpdateOptions { IsUpsert = true },
cancellationToken);

Is it possible to use lambda expression for the updateDefinition without using Builders ?

1 Like