Ejemplo n.º 1
0
        public void SetGlobalDataInterceptor <T>(DataInterceptor dataInterceptor) where T : class, IData
        {
            if (GlobalDataInterceptors.ContainsKey(typeof(T)))
            {
                throw new InvalidOperationException("A data interceptor has already been set");
            }

            GlobalDataInterceptors.Add(typeof(T), dataInterceptor);

            Log.LogVerbose(LogTitle,
                           $"Global Data interception added to the data type '{typeof (T)}' with interceptor type '{dataInterceptor.GetType()}'");
        }
Ejemplo n.º 2
0
        public void SetDataInterceptor <T>(DataInterceptor dataInterceptor) where T : class, IData
        {
            if (this.DataInterceptors.ContainsKey(typeof(T)))
            {
                throw new InvalidOperationException("A data interceptor has already been set");
            }

            this.DataInterceptors.Add(typeof(T), dataInterceptor);

            Log.LogVerbose(LogTitle, string.Format("Data interception added to the data type '{0}' with interceptor type '{1}'", typeof(T), dataInterceptor.GetType()));
        }