コード例 #1
0
        public Response <NoteDetail> RemoveTagNoteRelationship(int noteId, int tagId)
        {
            var tagNotQuery = _relationshipService.GetTagNoteRelationshipQuery(noteId, tagId);

            var removeResponse = _dbHelper.RemoveEntitiesByQuery(tagNotQuery);

            var updateHomelessResponse = UpdateHomelessTag(noteId);

            var noteResponse = _dbHelper.GetObjectByQuery <Notes, NoteDetail>(GetNoteQuery(noteId));

            if (removeResponse.Success)
            {
                return(Response <NoteDetail> .BuildResponse(noteResponse.Data));
            }
            else
            {
                return(Response <NoteDetail> .BuildResponse(noteResponse.Data, false, removeResponse.ReturnCode, removeResponse.ReturnMessage));
            }
        }