Beispiel #1
0
        /// <summary>
        /// POST /employees
        /// </summary>
        public object Post(HR.Dto.Employee request)
        {
            var newEmployeeId = _dataLayer.CreateNewEmployee(request.Translate());

            HttpResult httpResult = ValidateResult(request, newEmployeeId, HttpStatusCode.Created);

            return httpResult;
        }
Beispiel #2
0
        /// <summary>
        /// PUT /employees/{Id}
        /// </summary>
        public object Put(HR.Dto.Employee request)
        {
            var result = _dataLayer.UpdateEmployee(request.Translate());

            HttpResult httpResult = ValidateResult(request, result, HttpStatusCode.NoContent);

            return httpResult;
        }