GetValue() 공개 메소드

public GetValue ( DatabaseTable owner ) : object
owner Cornerstone.Database.Tables.DatabaseTable
리턴 object
예제 #1
0
        public HashSet <string> GetAllValues <T>(DBField field, DBRelation relation, ICollection <T> items) where T : DatabaseTable
        {
            // loop through all items in the DB and grab all existing values for this field
            HashSet <string> uniqueStrings = new HashSet <string>(StringComparer.CurrentCultureIgnoreCase);

            foreach (T currItem in items)
            {
                if (relation == null)
                {
                    List <string> values = getValues(field.GetValue(currItem));
                    foreach (string currStr in values)
                    {
                        uniqueStrings.Add(currStr);
                    }
                }
                else
                {
                    foreach (DatabaseTable currSubItem in relation.GetRelationList(currItem))
                    {
                        List <string> values = getValues(field.GetValue(currSubItem));
                        foreach (string currStr in values)
                        {
                            uniqueStrings.Add(currStr);
                        }
                    }
                }
            }

            return(uniqueStrings);
        }
예제 #2
0
        public HashSet <string> GetAllValues(DBField field)
        {
            ICollection items = Get(field.OwnerType, null);

            // loop through all items in the DB and grab all existing values for this field
            HashSet <string> uniqueStrings = new HashSet <string>(StringComparer.CurrentCultureIgnoreCase);

            foreach (DatabaseTable currItem in items)
            {
                List <string> values = getValues(field.GetValue(currItem));
                foreach (string currStr in values)
                {
                    uniqueStrings.Add(currStr);
                }
            }

            return(uniqueStrings);
        }