3

In this question, (How to map Model for a Schema, which has multiple value Component link field with multiple allowed Schemas?) Stan has given a step-by-step answer for the solution and Rick replied to his answer with several tips. One of the tips says:

Note that if you use a Prefix in your SemanticEntity annotation (which I would not recommend), you must also use that in your SemanticProperty annotation. For example: [SemanticProperty("s:componentLink")]

Why would a prefix annotation not be recommended?

3

That is purely for simplicity reasons (KISS principle). You need to use a prefix if:

  • You want to publicly expose the semantics (Public=true) in your HTML , e.g. for SEO purposes. In this case you should ensure you use a well-known, public vocabulary (e.g. schema.org).
  • You want to map a View Model type to multiple CM Schemas (by giving it multiple SemanticEntity annotations). In this case you should use a different prefix for each semantic type.

If you don't have these requirements, you can do without prefix. You can still use a prefix if you like complexity, though. :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.