ViewModel for the CustomField class
Ejemplo n.º 1
0
        public static CustomFieldViewModel Create(IRepository repository, Organization organization, CustomField customField = null)
        {
            Check.Require(repository != null, "Repository must be supplied");

            var viewModel = new CustomFieldViewModel {Organization = organization, CustomField = customField ?? new CustomField(){Organization = organization}};

            // assign the rank of the new custom field
            viewModel.CustomField.Rank = organization.CustomFields.Count;

            return viewModel;
        }
Ejemplo n.º 2
0
        public static CustomFieldViewModel Create(IRepository repository, Organization organization, CustomField customField = null)
        {
            Check.Require(repository != null, "Repository must be supplied");

            var viewModel = new CustomFieldViewModel {
                Organization = organization, CustomField = customField ?? new CustomField()
                {
                    Organization = organization
                }
            };

            // assign the rank of the new custom field
            viewModel.CustomField.Rank = organization.CustomFields.Count;

            return(viewModel);
        }