예제 #1
0
        public IActionResult Create([FromBody]  RealizationItem realizationItem)
        {
            _context.Add(realizationItem);

            _context.SaveChanges();
            return(CreatedAtRoute("GetRealizationItem", new { id = realizationItem.Id }, realizationItem));
        }
예제 #2
0
        public IActionResult Create()
        {
            Objective objective = new Objective();

            objective.Category = new Category {
                Id = -1
            };
            _context.Add(objective);
            _context.SaveChanges();
            return(CreatedAtRoute("GetObjective", new { id = objective.Id }, objective));
        }