Example #1
0
        public static TypedMessageFormat Define <M>(string template, params Expression <Func <M, object> >[] Selectors)
        {
            var result = template;

            Selectors.Mapi((i, selector)
                           => result = result.Replace($"@p{i + 1}", $"@{selector.GetValueMemberName()}"));
            var format = new TypedMessageFormat(typeof(M), result);

            _Formats.TryAdd(typeof(M), format);
            return(format);
        }