예제 #1
0
        public async Task <ActionResult <Childeren> > PostChilderen(Childeren childeren)
        {
            _context.Childeren.Add(childeren);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetChilderen", new { id = childeren.Id }, childeren));
        }
예제 #2
0
        public async Task <IActionResult> PutChilderen(long id, Childeren childeren)
        {
            if (id != childeren.Id)
            {
                return(BadRequest());
            }

            _context.Entry(childeren).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ChilderenExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
예제 #3
0
 public IContent GetItem(Guid?id)
 {
     if (id == null)
     {
         return(null);
     }
     return(Childeren.Where(m => m.DefinitionId == id).FirstOrDefault());
 }
예제 #4
0
        public VFSTree <T> AddChild(T child)
        {
            VFSTree <T> node = new VFSTree <T>(child)
            {
                Parent = this
            };

            Childeren.Add(node);
            Index = node;
            return(Index);
        }