public async Task <ActionResult <MiscExpenditure> > CreateExpenditure([FromBody] EditableJob coolz ) { return(Ok(_repo.AddOrUpdate(new Job() { Id = Guid.NewGuid(), LastModified = DateTimeOffset.Now, ClientId = coolz.ClientId, JobCode = coolz.JobCode, Name = coolz.Name, SiteId = coolz.SiteId }, x => x.Id))); }
public async Task <StatusCodeResult> UpdateExpenditure([FromBody] EditableJob coolz, [FromRoute(Name = "job-id")] Guid jobId) { var match = _repo.FindById(jobId); _repo.AddOrUpdate(new Job() { Id = match.Id, LastModified = DateTimeOffset.Now, ClientId = coolz.ClientId, JobCode = coolz.JobCode, Name = coolz.Name, SiteId = coolz.SiteId }, x => x.Id); return(Ok()); }