Don't automatically convert to number, since we are always using string for twin

This commit is contained in:
Darren Chuang 2017-01-05 11:38:18 +08:00
Родитель 3092963bce
Коммит 9304fb9d62
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -184,8 +184,9 @@ namespace Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Infr
private string AddQuoteIfNeeded(string value)
{
if (!(value.All(c => char.IsDigit(c)) && value.Any()) &&
!value.StartsWith("\'") &&
// Currently, we treat all properties as string while editing twin. We might give users an option to specifiy the data type(string, bool, or number) in the future.
// Do not check if is a number for now while generating sql
if (!value.StartsWith("\'") &&
!value.EndsWith("\'"))
{
value = $"\'{value}\'";