-
Notifications
You must be signed in to change notification settings - Fork 245
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
Черных Илья #214
base: master
Are you sure you want to change the base?
Черных Илья #214
Conversation
public PrintingConfig<TOwner> Using(CultureInfo culture) | ||
{ | ||
printingConfig.SpecifyTheCulture<TPropType>(culture); | ||
|
||
return ParentConfig; | ||
} |
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.
Сейчас можно написать что-то вроде ObjectPrinter.For<Person>().Printing(x=> x.Age).Using(CultureInfo.InvariantCulture)
и ожидаемым поведением будет применение культуры только к выбранному полю, а не всем полям с таким же типом. Стоит сделать, чтобы примениялось только к конкретному полю
{ | ||
public class PrintingConfig<TOwner> | ||
private readonly HashSet<Type> finalTypes = |
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.
В шарпе есть ещё куча базовых типов, но как минимум стоит добавть сериализацию для long и bool
ObjectPrinting/PrintingConfig.cs
Outdated
IFormattable format => | ||
format.ToString(null, CultureInfo.InvariantCulture), | ||
string str => str, | ||
_ => (string)obj |
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.
Такой каст в строку может стрельнуть, если тип не кастуется в строку. К примеру, bool так не кастуется
@xsitin