Page 1 of 1

Auto Generate DataMember For Multiplicity One Property

Posted: Tue 29 Jul 2014 06:43
by amirmokarram
Hi there
I want to entity developer to automatically add DataMember attribute to my properties that have Multiplicity One.
example:

Code: Select all

    public partial class PumpJob
    {
        ...

        [DataMember(Order = 10)]
        public virtual string InputFilter
        {
            get;
            set;
        }

        public virtual Storage Storage
        {
            get;
            set;
        }
        ...
    }
As you see in this example Entity Developer did not generate DataMember for Storage Property.

Re: Auto Generate DataMember For Multiplicity One Property

Posted: Fri 01 Aug 2014 16:48
by Shalex
1. Why do you need this attribute for properties that have Multiplicity One?
2. Please specify your ORM (e.g.: NHibernate), your template and its non-default settings. Send us a test model for reproducing the issue.

You can add this attribute via Attributes menu of Entity Developer:
a) navigate to Model > Settings > Attributes > select the assembly with the needed attributes and make sure that the needed attributes (DataMember, etc) are checked in the window below, press OK
b) select the needed attribute in the Attributes collection of a particular class property

Or modify a predefined template: right click on it in Model Explorer > Copy to Model Folder. After this, you can edit it with an embedded T4-Editor.