示例#1
0
 public TimeEntry Update(long id, TimeEntry timeEntry)
 {
     timeEntry.Id         = id;
     timeEntryobjects[id] = timeEntry;
     return(timeEntryobjects[id]);
 }
 public TimeEntry Update(long index, TimeEntry timeEntry)
 {
     timeEntry.Id       = index;
     timeEntries[index] = timeEntry;
     return(timeEntry);
 }
 public TimeEntry Create(TimeEntry timeEntry)
 {
     timeEntry.Id = ++_count;
     _timeEntryRepository.Add(_count, timeEntry);
     return(timeEntry);
 }
示例#4
0
 public TimeEntry Update(long id, TimeEntry timeEntry)
 {
     timeEntry.Id = id;
     repo[id]     = timeEntry;
     return(timeEntry);
 }
示例#5
0
 public TimeEntry Create(TimeEntry timeEntry)
 {
     timeEntry.Id = ++IdCounter;
     Dictionary.Add(IdCounter, timeEntry);
     return(timeEntry);
 }
 public TimeEntry Update(long id, TimeEntry timeEntry)
 {
     timeEntry.Id             = id;
     _timeEntryRepository[id] = timeEntry;
     return(timeEntry);
 }
示例#7
0
        public ActionResult Create([FromBody] TimeEntry toCreate)
        {
            var timeEntry = this.Repository.Create(toCreate);

            return(new CreatedAtRouteResult("GetTimeEntry", new { id = timeEntry.Id }, timeEntry));
        }
 public TimeEntry Create(TimeEntry timeEntry)
 {
     timeEntry.Id = repo.Count + 1;
     repo.Add(timeEntry);
     return(timeEntry);
 }
示例#9
0
 public TimeEntry Create(TimeEntry timeEntry)
 {
     timeEntry.Id = ++entryId;
     _timeEntries.Add(entryId, timeEntry);
     return(timeEntry);
 }
 public TimeEntry Update(long Id, TimeEntry timeEntry)
 {
     timeEntry.Id     = Id;
     _timeEntries[Id] = timeEntry;
     return(timeEntry);
 }
 public TimeEntry Create(TimeEntry timeEntry)
 {
     timeEntry.Id = timeEntrys.Count + 1;
     timeEntrys.Add(timeEntry);
     return(timeEntrys[timeEntrys.Count - 1]);
 }
 public TimeEntry Create(TimeEntry entry)
 {
     entry.Id = TimeEntryList.Count + 1;
     TimeEntryList.Add(item: entry);
     return(entry);
 }
示例#13
0
 public TimeEntry Update(long id, TimeEntry timeEntry)
 {
     timeEntry.Id   = id;
     Dictionary[id] = timeEntry;
     return(timeEntry);
 }
示例#14
0
        public IActionResult  Create([FromBody] TimeEntry timeentry)
        {
            var createdTimeEntry = _repository.Create(timeentry);

            return(CreatedAtRoute("GetTimeEntry", new { id = createdTimeEntry.Id }, createdTimeEntry));
        }
示例#15
0
 public TimeEntry Update(long id, TimeEntry timeEntry)
 {
     timeEntry.Id           = id;
     _inMemoryTimeEntry[id] = timeEntry;
     return(timeEntry);
 }
示例#16
0
 public IActionResult  Update(int id, [FromBody] TimeEntry timeentry)
 {
     return(_repository.Contains(id) ? (IActionResult)Ok(_repository.Update(id, timeentry)) : NotFound());
 }
 public TimeEntry Update(long itemNumber, TimeEntry timeEntry)
 {
     timeEntry.Id            = itemNumber;
     timeEntries[itemNumber] = timeEntry;
     return(timeEntries[itemNumber]);
 }
        public IActionResult Update(long id, [FromBody] TimeEntry timeEntry)
        {
            _operationCounter.Increment(TrackedOperation.Update);

            return(_repository.Contains(id) ? (IActionResult)Ok(_repository.Update(id, timeEntry)) : NotFound());
        }
        public object Create([FromBody] TimeEntry toCreate)
        {
            TimeEntry timeEntry = _repository.Create(toCreate);

            return(new CreatedAtRouteResult("GetTimeEntry", new { id = timeEntry.Id }, timeEntry));
        }