Beispiel #1
0
        //custom
        protected override void PreValidate()
        {
            if (string.IsNullOrEmpty(Alias))
            {
                Alias = Name;
            }

            if (Label == string.Empty)
            {
                Label = Alias;
            }

            if (Type != "string")
            {
                DefaultBlank = true;
            }

            if (Type == "rowversion")
            {
                Length = "8";
            }

            if (PrimaryKey && !Output)
            {
                Warn("Primary Keys must be output. Overriding output to true for {0}.", Alias);
                Output = true;
            }

            if (SearchType != string.Empty && SearchTypes.All(st => st.Name != SearchType))
            {
                SearchTypes.Insert(0, this.GetDefaultOf <NameReference>(st => { st.Name = SearchType; }));
            }
        }
Beispiel #2
0
 private void ValidateSearchTypes()
 {
     foreach (var name in GetAllFields().SelectMany(f => f.SearchTypes).Select(st => st.Name).Distinct())
     {
         if (SearchTypes.All(st => st.Name != name))
         {
             Error("Search type {0} is invalid.", name);
         }
     }
 }
Beispiel #3
0
        void PreValidateDefaultSearchTypes()
        {
            if (SearchTypes.All(st => st.Name != "none"))
            {
                SearchTypes.Add(this.GetDefaultOf <SearchType>(st => {
                    st.Name        = "none";
                    st.MultiValued = false;
                    st.Store       = false;
                    st.Index       = false;
                }));
            }

            if (SearchTypes.All(st => st.Name != "default"))
            {
                SearchTypes.Add(this.GetDefaultOf <SearchType>(st => {
                    st.Name        = "default";
                    st.MultiValued = false;
                    st.Store       = true;
                    st.Index       = true;
                }));
            }
        }