-
Notifications
You must be signed in to change notification settings - Fork 222
Махлонов Дмитрий #195
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?
Махлонов Дмитрий #195
Conversation
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.
Получился хороший результат, осталось только посмотреть несколько моментов с потенциальными исключениями
| @@ -0,0 +1,57 @@ | |||
| namespace ResultTools; | |||
|
|
|||
| public class Result<T> | |||
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.
Если пытаться избавиться от Result<None>, то можно посмотреть как сделаны Task и Task<T>. Тогда бы ошибка и IsSuccess вынеслись в Result, а Result<T>:Result принёс ещё и Value. Но в этом случае придётся немного переписать (дописать) методы расширений. Тогда пропадёт такая особенность, что в метод передаётся None при вызове Then(none =>)
|
|
||
| var format = splittedPath.Last(); | ||
|
|
||
| var reader = readers.FirstOrDefault(r => r.SupportedFormats().Contains(format.ToLower())); |
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.
Если обращение происходит часто, лучше обернуть все ридеры в словарь на этапе инициализации. Так как линейное итерирование может потребовать много времени.
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.
мне кажется конкретно в этом проекте обращение проходит достаточно редко, а способ более удобный, чем словарь
No description provided.