Esempio n. 1
0
        private void UpsertEmployee(GetEmployeeResponse request)
        {
            var upsertEmployeeRequest = new UpsertEmployeeRequest
            {
                FirstName = request.FirstName,
                LastName  = request.LastName
            };

            if (request.Id > 0)
            {
                var updateEmployee = Task.Run(() => HttpRequests.UpdateEmployee(request.Id, upsertEmployeeRequest));

                updateEmployee.Wait();
            }

            else
            {
                var createEmployee = Task.Run(() => HttpRequests.CreateEmployee(upsertEmployeeRequest));

                createEmployee.Wait();
            }
        }