-
Notifications
You must be signed in to change notification settings - Fork 2
Добавить эндпойнт "Сумма прописью" #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
bzaar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В остальном все нормально, но пока не будем мерджить, пока не будет принят основной PR.
|
|
||
| using (var client = _newClient()) | ||
| { | ||
| client.AddParam("n", n.ToString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я бы добавил: ToString(CultureInfo.InvariantCulture). Иначе все может работать, пока на хостинге добрый дядя не поменяет региональные настройки.
| } | ||
| } | ||
|
|
||
| public SummaPropisResult SpellSum(decimal n, string currency, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Переименуй SpellSum в GetPropis, пожалуйста.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А SummaPropisResult - в Propis.
|
@bzaar Не подскажете, почему не может создать ответ из Propis-а? Разные варианты атрибутов попробовал поставить внутри класса, но все равно не может сформировать. |
|
Не очень понял. Что именно ты делаешь и что получаешь? |
Не в том PR-e написал вопрос. |
bzaar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
См. комментарии
| client.AddParam("nbsp", nbsp); | ||
| client.AddParam("delim", delim); | ||
|
|
||
| return client.GetObject<Propis>("/russian/propis"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А обработка ошибок? Что если сервис вернет ошибку 400? Нужно преобразовать ее в известное исключение.
| public class Propis | ||
| { | ||
| [DataMember] | ||
| public string propis1 { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[XmlElement]?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А зачем он? Вроде в других классах такого не было.
| public string propis1 { get; set; } | ||
|
|
||
| [DataMember] | ||
| public string propis2 { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В C# свойства принято называть с большой буквы: Propis2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ок
|
Добавил изменения по замечаниям. |
https://github.com/morpher-ru/morpher/issues/603