Пример #1
0
        private Dictionary <string, string> GetTokens(EmailViewModel vm)
        {
            _logger.LogInformation($"CreateInvitationHandler : GetTokens : ViewModel: {JsonConvert.SerializeObject(vm)}");

            return(vm.GetType()
                   .GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly)
                   .ToDictionary(propertyInfo => propertyInfo.Name, propertyInfo => propertyInfo.GetValue(vm).ToString()));
        }
Пример #2
0
 private Dictionary <string, string> GetTokens(EmailViewModel vm)
 {
     return(vm.GetType()
            .GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly)
            .ToDictionary(propertyInfo => propertyInfo.Name, propertyInfo => propertyInfo.GetValue(vm).ToString()));
 }