public IActionResult Create([FromBody] TimeEntry timeEntry)
        {
            _operationCounter.Increment(TrackedOperation.Create);
            var createdTimeEntry = _repository.Create(timeEntry);

            return(CreatedAtRoute("GetTimeEntry", new { id = createdTimeEntry.Id }, createdTimeEntry));
        }
        public IActionResult Create([FromBody] TimeEntry timeEntry)
        {
            var createdTimeEntry = _repository.Create(timeEntry);

            // return Ok("post exected...");
            return(CreatedAtRoute("GetTimeEntry", new { id = createdTimeEntry.Id }, createdTimeEntry));
        }
Esempio n. 3
0
        public IActionResult Create([FromBody] TimeEntry timeEntry)
        {
            TimeEntry createdEntry = _repository.Create(timeEntry);

            _counter.Increment(TrackedOperation.Create);
            return(new CreatedAtRouteResult("GetTimeEntry", new { id = createdEntry.Id }, createdEntry));
        }
Esempio n. 4
0
        public object Create([FromBody] TimeEntry toCreate)
        {
            _operationCounter.Increment(TrackedOperation.Create);
            TimeEntry timeEntry = _repository.Create(toCreate);

            return(new CreatedAtRouteResult("GetTimeEntry", new { id = timeEntry.Id }, timeEntry));
        }
        public IActionResult Create([FromBody] TimeEntry timeEntry)
        {
            _operationCounter.Increment(TrackedOperation.Create);

            TimeEntry timeEntry1 = _timeEntryRepository.Create(timeEntry);

            return(CreatedAtRoute("GetTimeEntry", new { id = timeEntry1.Id }, timeEntry1));
        }
Esempio n. 6
0
        public IActionResult Create([FromBody] TimeEntry timeEntry)
        {
            counter.Increment(TrackedOperation.Create);
            TimeEntry timeEntryCreated;

          
            timeEntryCreated=repo.Create(timeEntry);
            return CreatedAtRoute("GetTimeEntry", new {id = timeEntryCreated.Id}, timeEntryCreated);
        }
Esempio n. 7
0
        public IActionResult Create([FromBody] TimeEntry entry)
        {
            _operationCounter.Increment(TrackedOperation.Create);

            if (entry.Id.HasValue && _timeEntryRepository.Contains(entry.Id.Value))
            {
                return(BadRequest());
            }
            entry = _timeEntryRepository.Create(entry);
            return(CreatedAtRoute("GetTimeEntry", new { id = entry.Id }, entry));
        }
        public IActionResult Create([FromBody] TimeEntry timeEntry)
        {
            TimeEntry timeEntryCreated;

            /*if (timeEntry.ProjectId == 0 || timeEntry.UserId == 0 || timeEntry.Date == null || timeEntry.Hours == 0)
             * //if (!ModelState.IsValid)
             * {
             *  return BadRequest();
             * }*/

            timeEntryCreated = _inMemoryTimeEntryRepository.Create(timeEntry);
            return(CreatedAtRoute("GetTimeEntry", new { id = timeEntryCreated.Id }, timeEntryCreated));
        }
        public IActionResult Create([FromBody] TimeEntry timeEntry)
        {
            var created = _repository.Create(timeEntry);

            return(CreatedAtRoute("GetTimeEntry", new { id = created.Id }, created));
        }
        public object Create([FromBody] TimeEntry toCreate)
        {
            TimeEntry timeEntry = _repository.Create(toCreate);

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