Dynamic object question

Topics: Writing modules
Aug 2, 2012 at 11:17 PM

Hi All,

I'm making good progress on my new module, but I have a question..

Consider:

list.AddRange(_blogService.Get(VersionOptions.Latest)
                              .Select(b => {
                                          var blog = Services.ContentManager.BuildDisplay(b, "SummaryAdmin");
                                          blog.TotalPostCount = _blogPostService.Get(b, VersionOptions.Latest).Count();
                                          return blog;
                                      }));

            dynamic viewModel = Services.New.ViewModel()
                .ContentItems(list);

Now I'd like to know how to access blog.TotalPostCount, if possible. This is because I want to pass an ID value in the same fashion to the model used in my summary admin view, and access it from the dynamic object. I've never worked with dynamic stuff before, and it's not really clicking with me so far..

All help greatly appreciated.

Coordinator
Aug 3, 2012 at 6:57 PM

Access it from where?