public IActionResult Get(int id) { CostJournal costJournal = _context.CostJournal.FirstOrDefault(x => x.CostID == id); if (costJournal == null) { return(NotFound()); } return(new ObjectResult(costJournal)); }
public IActionResult Post([FromBody] CostJournal costJournal) { if (costJournal == null) { return(BadRequest()); } _context.CostJournal.Add(costJournal); _context.SaveChanges(); return(Ok(costJournal)); }
public IActionResult Delete(int id) { CostJournal costJournal = _context.CostJournal.FirstOrDefault(x => x.CostID == id); if (costJournal == null) { return(NotFound()); } _context.CostJournal.Remove(costJournal); _context.SaveChanges(); return(Ok(costJournal)); }