REPOSITORY METHOD
public int CalculateSoundVolume(string roomName, int currentUser)
{
{
//Business Logic
return finalApplauseVolume; //**say returning 75**
}
catch (Exception ex)
{
_logger.LogException(ex);
throw;
}
}
WEB API CONTROLLER
public IHttpActionResult CalculateSoundVolume()
{
try
{
//Some Logic
var result = _applauseRepository.CalculateSoundVolume(huddleName, currentUser);
return Ok(result); // **it returns 75 here in result**
}
catch (Exception ex)
{
_logger.LogException(ex);
throw;
}
}
CLIENT SIDE CONTROLLER (ANGULAR JS)
public calculateSoundVolume()
{
var promise = this.applauseService.calculateSoundVolume();
promise.then((res) => {
this.$log.debug("Sound Volume : ", res);
// Getting Resource [0] : '7' and [1] : '5'
});
}
SERVICE
calculateSoundVolume()
{
return this.soundVolume.get().$promise;
}
Now here the scenario is i am returning an integer value from my Repository method. (say 75). I the WEB API controller the value is recieved as 75 in result. But the issue is in "res" in my client side controller i am recieving a Resource as [0]:'7' and [1]: '5' i.e the actual and expected value is not recieved. Please suggest any solution