Ejemplo n.º 1
0
        public async Task <bool> AddTerm(EditTermModel model)
        {
            using (var session = _db.GetSession())
            {
                var result = await session.RunAsync(_transactions.AddTerm(model), model);

                var record = await result.SingleAsync();

                long nodeId;
                if (!(record.Values.Single().Value is INode node))
                {
                    return(false);
                }
Ejemplo n.º 2
0
        public async Task <ActionResult <bool> > UpdateTerm(long id, [FromBody] EditTermModel model)
        {
            if (model == null)
            {
                return(BadRequest("Model is empty"));
            }

            if (!ModelState.IsValid)
            {
                return(BadRequest("Model is not valid"));
            }

            return(Ok(await _termService.UpdateTerm(id, model)));
        }
Ejemplo n.º 3
0
        public string AddTerm(EditTermModel model)
        {
            var str = "CREATE (n:Term) " +
                      "SET n.name = $Name " +
                      ", n.description = $Description " +
                      ", n.isFullMatch = $IsFullMatch " +
                      $", n.status = {(int)Status.Uningexed} ";

            if (model.Source != null)
            {
                str += ", n.source = $Source ";
            }

            str += "RETURN n ";

            return(str);
        }