Closed digital88 closed 7 years ago
@digital88, thank you for reporting this one.
It's a great idea and we had a few similar suggestions reported early. We'd be happy to implement this feature. However, it doesn't seem to be related to a particular SharePoint API. SPMeta2 maps and provides POCOs for most of the SharePoint objects without a particular opinion but in this case, we would be providing some kind of custom logic with a particular opinion on how it should work.
Simply saying, this does look like a component or some kind of extension for SPMeta2 library rather than definition. Having this one as some kind of plugin or component for SPMeta2 would be a better fit, we guess.
Next, you can still implement this one with SPMeta2. You need to add list, and then add all fields, and then add property bag value to the root folder. Natively, it would be a quite verbose syntax with .AddList(), .AddFieldLink() and AddProperty() but you can wrap it up into a custom syntax to simplify the usage:
You might end up with something as this where .AddListWithRatings() method is your custom syntax. Internaly, it would get the list definition, add it to the model, and then add all the required fields and property bags.
var webModel = SPMeta2Model.NewWebModel(web => {
web.AddListWithRatings(you-list-definition);
});
That way you still stay on SPMeta2, your model is serializable, you still can deploy with CSOM/SSOM.
What do you think?
Yes, I think I will just rewrite it in a couple of SPMeta AddXXX() methods.
Sweet, thank you. We probably need to blog about it. How is the rest? No major blockers?
Hello. It would be great if SPMeta2 could enable ratings in lists during provisioning. Right now, I do it like this: