public static object ReadObjectValue(IGenericBusinessObj obj, string name, ObjectStateEntry currentEntry)
        {
            List <BusinessObjectStructure> tableFields = obj.GetTableFields(currentEntry);

            Adage.EF.Interfaces.BusinessObjectStructure fieldToGet = tableFields.Where(c => c.Name == name).FirstOrDefault();

            if (fieldToGet == null)
            {
                throw new ApplicationException("Could not find the property:" + name);
            }

            if (fieldToGet.IsCSpaceColumn)
            {
                return(currentEntry.CurrentValues.GetValue(fieldToGet.CSpaceIndex.Value));
            }
            else
            {
                return(fieldToGet.PropertyInfo.GetValue(obj, null));
            }
        }
        public static object ReadObjectValue(IGenericBusinessObj obj, int index, ObjectStateEntry currentEntry)
        {
            List <BusinessObjectStructure> tableFields = obj.GetTableFields(currentEntry);

            if (index < 0 || index > tableFields.Count)
            {
                throw new ApplicationException(string.Format(
                                                   "Could not find the index:{0} in {1}",
                                                   index, obj.GetType().ToString()));
            }

            BusinessObjectStructure fieldToGet = tableFields[index];

            if (fieldToGet.IsCSpaceColumn)
            {
                return(currentEntry.CurrentValues.GetValue(fieldToGet.CSpaceIndex.Value));
            }
            else
            {
                return(fieldToGet.PropertyInfo.GetValue(obj, null));
            }
        }
        public static object ReadObjectValue(IGenericBusinessObj obj, string name, ObjectStateEntry currentEntry)
        {
            List<BusinessObjectStructure> tableFields = obj.GetTableFields(currentEntry);
            Adage.EF.Interfaces.BusinessObjectStructure fieldToGet = tableFields.Where(c => c.Name == name).FirstOrDefault();

            if (fieldToGet == null)
                throw new ApplicationException("Could not find the property:" + name);

            if (fieldToGet.IsCSpaceColumn)
                return currentEntry.CurrentValues.GetValue(fieldToGet.CSpaceIndex.Value);
            else
                return fieldToGet.PropertyInfo.GetValue(obj, null);
        }
        public static object ReadObjectValue(IGenericBusinessObj obj, int index, ObjectStateEntry currentEntry)
        {
            List<BusinessObjectStructure> tableFields = obj.GetTableFields(currentEntry);
            if (index < 0 || index > tableFields.Count)
                throw new ApplicationException(string.Format(
                    "Could not find the index:{0} in {1}",
                    index, obj.GetType().ToString()));

            BusinessObjectStructure fieldToGet = tableFields[index];

            if (fieldToGet.IsCSpaceColumn)
                return currentEntry.CurrentValues.GetValue(fieldToGet.CSpaceIndex.Value);
            else
                return fieldToGet.PropertyInfo.GetValue(obj, null);
        }