public async Task <IActionResult> UpdateKPI(int empId, string KeyResultAreaId, JsonPatchDocument <KeyResultAreaForUpdateDto> entityForUpdate)
        {
            ObjectId Id        = new ObjectId(KeyResultAreaId);
            var      keyResult = await resultArea.QuerySingleByUserId(Id, empId);

            if (keyResult == null)
            {
                return(NotFound());
            }
            var aa = new KeyResultAreaForUpdateDto();

            var resultAreaToPatch = mapper.Map <KeyResultArea, KeyResultAreaForUpdateDto>(keyResult);

            entityForUpdate.ApplyTo(resultAreaToPatch);
            mapper.Map(resultAreaToPatch, keyResult);

            var entityToUpdate = await resultArea.Update(Id, keyResult);

            var entityToReturn = mapper.Map <KeyResultAreaDtoForCreation>(entityToUpdate);

            return(Ok(entityToReturn));
        }
        public async Task <IActionResult> UpdateKPIs(int empId, string KeyResultAreaId, KeyResultAreaForUpdateDto entityForUpdate)
        {
            ObjectId Id        = new ObjectId(KeyResultAreaId);
            var      keyResult = await resultArea.QuerySingleByUserId(Id, empId);

            if (keyResult != null)
            {
                var resultAreaForUpdate = mapper.Map <KeyResultAreaForUpdateMainDto>(entityForUpdate);

                var entityToUpdate = resultArea.Update(Id, resultAreaForUpdate);
                var entityToReturn = mapper.Map <KeyResultAreaDtoForCreation>(entityToUpdate);

                return(CreatedAtRoute("Mykpi", new { empId = empId }, entityToReturn));
            }

            return(NotFound());
        }