Exemple #1
0
        private static void AddInstance(Dictionary<string, Dictionary<string, Row>> registry, Row row)
        {
            try
            {
                var connectionKey = GetConnectionKey(row.GetType());
                Dictionary<string, Row> connectionRegistry;
                if (!registry.TryGetValue(connectionKey, out connectionRegistry))
                    registry[connectionKey] = connectionRegistry = new Dictionary<string, Row>(StringComparer.OrdinalIgnoreCase);

                var table = row.Table;

                connectionRegistry.Add(table, row);
            }
            catch (Exception ex)
            {
                new InvalidOperationException(String.Format("Can't register Row instance in DataSchema: {0}",
                    row.GetType().FullName), ex).Log();
            }
        }
Exemple #2
0
 public static string GetConnectionKey(Row row)
 {
     return GetConnectionKey(row.GetType());
 }
Exemple #3
0
        protected void CheckUnassignedRead(Row row)
        {
            if (row == null)
                throw new ArgumentNullException("row");

            if (!row.tracking)
                return;

            if (!row.trackWithChecks)
                return;

            if (row.IsAssigned(this))
                return;

            if (!this.GetIsNull(row))
                return;

            throw new InvalidOperationException(String.Format(
                "{0} field on {1} is read before assigned a value!", this.Name, row.GetType().Name));
        }