public async Task AddTypeNote(TypeNoteModel item) { try { await _context.TypeNotes.InsertOneAsync(item); }catch (Exception ex) { throw ex; } }
public async Task <bool> UpdateTypeNote(string id, TypeNoteModel item) { try { var updatedItem = new TypeNoteModel { UpdatedOn = DateTime.Now, Title = item.Title, NoteId = item.NoteId }; ReplaceOneResult actionResult = await _context.TypeNotes.ReplaceOneAsync(Builders <TypeNoteModel> .Filter.Eq("_id", id), updatedItem, new UpdateOptions { IsUpsert = true }); return(actionResult.IsAcknowledged && actionResult.ModifiedCount > 0); } catch (Exception ex) { throw ex; } }