public async Task UpdateAsync(Entity entity, CancellationToken cancellationToken = new CancellationToken()){ cancellationToken.ThrowIfCancellationRequested(); if (entity == null) { throw new ArgumentNullException("entity"); }
await _context.Entities.UpdateOneAsync(a => a.Id == entity.Id, entity, new UpdateOptions {IsUpsert = true}, cancellationToken: cancellationToken);}...
if (!_elementNameValidator.IsValidElementName(name)){ var message = string.Format("Element name '{0}' is not valid'.", name); throw new BsonSerializationException(message);}
...
public class WikiPage
{
public ObjectId Id { get; set; }
public string TitleSlug { get; set; }
public string Title { get; set; }
public string Intro { get; set; }
public string Contents { get; set; }
public DateTime Created { get; set; }
public DateTime Edited { get; set; }
}
Op zondag 1 maart 2015 23:17:05 UTC+1 schreef Craig Wilson: