public List <Mark> AddToObjective(dynamic body) { List <Mark> listMark = new List <Mark>(); foreach (var item in body) { var listJob = _serviceJob.AddJobs(item.job); if ((item.term != null) || (item.term != "")) { if (item.id != null) { listMark.Add( Update(new UpdateMarkCommand( Guid.Parse((string)item.id), listJob, (DateTime)item.term, (string)item.description))); } else { listMark.Add(new Mark( (DateTime)item.term, listJob, (string)item.description)); } } if (item.id != null) { _serviceJob.CheckJobRemovedOfMark(listJob, Guid.Parse((string)item.id)); } } return(listMark); }