public Task <UpdateResult> StoreAsync(StoredScope entity) { Expression <Func <StoredScope, bool> > filter = x => x.Name == entity.Name; var update = Builders <StoredScope> .Update //.Set(x => x.Id, entity.Id) .Set(x => x.Name, entity.Name) .Set(x => x.DisplayName, entity.DisplayName) .Set(x => x.Description, entity.Description) .Set(x => x.Required, entity.Required) .Set(x => x.Emphasize, entity.Emphasize) .Set(x => x.ShowInDiscoveryDocument, entity.ShowInDiscoveryDocument) .Set(x => x.UserClaims, entity.UserClaims); return(_scope.UpdateOneAsync(filter, update, new UpdateOptions { IsUpsert = true })); }
public static Scope ToModel(this StoredScope token) { return(Mapper.Map <StoredScope, Scope>(token)); }