public async Task DeleteAsync(string appId, string id, CancellationToken ct = default) { using (Telemetry.Activities.StartActivity("MongoDbChannelTemplateRepository/DeleteAsync")) { var docId = MongoDbChannelTemplate <T> .CreateId(appId, id); await Collection.DeleteOneAsync(x => x.DocId == docId, ct); } }
public async Task <(ChannelTemplate <T>?Template, string?Etag)> GetAsync(string appId, string code, CancellationToken ct = default) { using (Telemetry.Activities.StartActivity("MongoDbChannelTemplateRepository/GetAsync")) { var docId = MongoDbChannelTemplate <T> .CreateId(appId, code); var document = await GetDocumentAsync(docId, ct); return(document?.ToChannelTemplate(), document?.Etag); } }