Guest User

Untitled

a guest
Feb 19th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. public string ProcessTemplate(Template templateToProcess, object templateModel)
  2. {
  3. var tokenDictionary = new Dictionary<string, string>();
  4. var templateModelProperties = templateModel.GetType().GetProperties();
  5.  
  6. foreach (var property in templateModelProperties)
  7. {
  8. var key = property.Name;
  9. var value = (string) property.GetValue(templateModel, null);
  10.  
  11. tokenDictionary.Add(key,value);
  12. }
  13.  
  14. return ProcessTemplate(templateToProcess, tokenDictionary);
  15. }
Add Comment
Please, Sign In to add comment