public static LocalizedString GetString <TResource, TProperty>(this IStringLocalizer <TResource> localizer,
                                                                       Expression <Func <TResource, TProperty> > propertyExpression, params object[] arguments)
            where TResource : class
        {
            localizer.NotNull(nameof(localizer));

            var name = propertyExpression.AsPropertyName();

            return(localizer[name, arguments]);
        }
Exemple #2
0
 public HumanizationService(IStringLocalizer <HumanizationResource> localizer,
                            ILoggerFactory loggerFactory)
     : base(loggerFactory)
 {
     _localizer = localizer.NotNull(nameof(localizer));
 }