private static Dictionary <IColumn, object> GetYapperColumnValues(object dataContract)
        {
            PropertyInfo[] propertyInfoArray          = dataContract.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance);
            Dictionary <IColumn, object> columnValues = new Dictionary <IColumn, object>();

            foreach (PropertyInfo propInfo in propertyInfoArray)
            {
                IEnumerable <Attribute> attrs = propInfo.GetCustomAttributes();
                if (attrs == null)
                {
                    continue;
                }

                foreach (Attribute a in attrs)
                {
                    if (a is YapperColumnAttribute)
                    {
                        YapperColumnAttribute yapperColumn = a as YapperColumnAttribute;

                        IColumn column = MessageTable.GetColumnFromName(yapperColumn.Name);
                        if (column != null)
                        {
                            columnValues.Add(column, DataContractToTableRowConverter.Convert(propInfo.GetValue(dataContract), column.Type));
                        }
                    }
                }
            }

            return(columnValues);
        }
        private static void SetYapperColumnValues(Message message, ITableRow row)
        {
            PropertyInfo[] propertyInfoArray = message.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance);

            foreach (PropertyInfo propInfo in propertyInfoArray)
            {
                IEnumerable <Attribute> attrs = propInfo.GetCustomAttributes();
                if (attrs == null)
                {
                    continue;
                }

                IColumn column     = null;
                bool    isDbColumn = false;
                bool    isInBlob   = false;;
                foreach (Attribute a in attrs)
                {
                    if (a is YapperColumnAttribute && ((YapperColumnAttribute)a).ColumnLocation == ColumnLocation.Database)
                    {
                        isDbColumn = true;
                        YapperColumnAttribute yapperColumn = a as YapperColumnAttribute;
                        column = MessageTable.GetColumnFromName(yapperColumn.Name);
                    }

                    if (a is ProtoBuf.ProtoMemberAttribute)
                    {
                        isInBlob = true;
                    }
                }

                if (column != null && isDbColumn && !isInBlob)
                {
                    propInfo.SetValue(message, row.ColumnValues[column]);
                }
            }
        }