コード例 #1
0
ファイル: RowRegistry.cs プロジェクト: VictorTomaili/Sanity
        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();
            }
        }
コード例 #2
0
ファイル: RowRegistry.cs プロジェクト: VictorTomaili/Sanity
 public static string GetConnectionKey(Row row)
 {
     return GetConnectionKey(row.GetType());
 }
コード例 #3
0
ファイル: Field.cs プロジェクト: VictorTomaili/Sanity
        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));
        }