|
|
|
@ -20,8 +20,13 @@ public class GetPaginationSettingsHandler : IRequestHandler<GetPaginationSetting |
|
|
|
ConfigElementKey.PagesDefaultPageSize, |
|
|
|
ConfigElementKey.PagesDefaultPageSize, |
|
|
|
cancellationToken); |
|
|
|
cancellationToken); |
|
|
|
|
|
|
|
|
|
|
|
int defaultPageSize = PaginationOptions.NormalizePageSize( |
|
|
|
Option<int> maybePageSize = |
|
|
|
maybeElement.Bind<int?>(element => int.TryParse(element.Value, out int value) ? value : null)); |
|
|
|
maybeElement.Bind(element => |
|
|
|
|
|
|
|
int.TryParse(element.Value, out int value) |
|
|
|
|
|
|
|
? Prelude.Some(value) |
|
|
|
|
|
|
|
: Option<int>.None); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int defaultPageSize = PaginationOptions.NormalizePageSize(maybePageSize.ToNullable()); |
|
|
|
|
|
|
|
|
|
|
|
return new PaginationSettingsViewModel { DefaultPageSize = defaultPageSize }; |
|
|
|
return new PaginationSettingsViewModel { DefaultPageSize = defaultPageSize }; |
|
|
|
} |
|
|
|
} |
|
|
|
|