DataAbstraction and PageTypeAvailability

Vote:
 

Hi

From 7.5 I am not able to get a setting this way. PageTypeAvailability is still there, but AvailableSetting is not. Anybody knows other way to get it or where is it moved?

var setting = new EPiServer.DataAbstraction.PageTypeAvailability.AvailableSetting();

Thanx

#79768
Jan 04, 2014 21:50
Vote:
 

Try this:

var service = ServiceLocator.Current.GetInstance<IAvailableContentTypes>();
AvailableSetting settings = service.GetSetting(/*ContentType name*/Name);

    

Or:

var repository  = ServiceLocator.Current.GetInstance<IContentTypeRepository>();
var allSettings = repository.ListSettings();

    

Hope that help!

// Ha Bui

#79771
Jan 06, 2014 3:39
Vote:
 

Thank you Ha! It works.

#79841
Jan 08, 2014 12:22
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.