More in this section
Forums / Sitefinity SDK / How to create instance of a Dynamic Type?

How to create instance of a Dynamic Type?

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. Apptain
    Apptain avatar
    30 posts
    20 Aug 2012
    01 Mar 2011
    Link to this post
    In the documentation you have the below example for how to create a DynamicType, but after creating the dynamic "ContactInfo" type how can I create an instance of it?

           .CreateNew("ContactInfo", "Telerik.Sitefinity.DynamicTypes.Model")
           .Do(dt => dt.DatabaseInheritance = DatabaseInheritanceType.vertical)
                .CreateNew("FirstName", typeof(string))
                .CreateNew("LastName", typeof(string))
                .CreateNew("Age", typeof(int))
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    02 Mar 2011
    Link to this post
    Hello Joseph,

    You need to create manager and provider if you want to use the custom type as an instance.The Sitefinity API does not currently allow you to manage dynamic types without having a manager. We are planning to include a new manager that will automate this and make it easier for you to create new dynamic types and work with them. Please take a look at this post for more information.

    Ivan Dimitrov
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
2 posts, 0 answered