示例#1
0
 private ModelContext(Type t)
 {
     Info     = ObjectInfoFactory.Instance.GetInstance(t);
     Provider = DataProviderFactory.Instance.GetInstance(Info.ContextName);
     Composer = GetQueryComposer();
     if (LoadHandler)
     {
         Handler = CreateDbObjectHandler();
     }
     if (ConfigReader.Config.Database.Cache.Enabled && Info.HasOnePrimaryKey && Info.Cacheable)
     {
         Operator = new CachedModelOperator(Info, Composer, Provider, Handler);
     }
     else
     {
         Operator = new ModelOperator(Info, Composer, Provider, Handler);
     }
 }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VisibleCondition" /> class.
 /// </summary>
 /// <param name="capability">capability (required).</param>
 /// <param name="version">The version number of the capability. (default to 1).</param>
 /// <param name="component">component.</param>
 /// <param name="value">Notation which indicates the value of an attribute.</param>
 /// <param name="_operator">_operator.</param>
 /// <param name="operand">The value that the visible condition evaluates against..</param>
 public VisibleCondition(string capability = default(string), int version = 1, string component = default(string), string value = default(string), ModelOperator _operator = default(ModelOperator), string operand = default(string))
 {
     // to ensure "capability" is required (not null)
     this.Capability = capability ?? throw new ArgumentNullException("capability is a required property for VisibleCondition and cannot be null");
     this.Version    = version;
     this.Component  = component;
     this.Value      = value;
     this.Operator   = _operator;
     this.Operand    = operand;
 }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VisibleConditionAllOf" /> class.
 /// </summary>
 /// <param name="component">component.</param>
 /// <param name="value">Notation which indicates the value of an attribute.</param>
 /// <param name="_operator">_operator.</param>
 /// <param name="operand">The value that the visible condition evaluates against..</param>
 public VisibleConditionAllOf(string component = default(string), string value = default(string), ModelOperator _operator = default(ModelOperator), string operand = default(string))
 {
     this.Component = component;
     this.Value     = value;
     this.Operator  = _operator;
     this.Operand   = operand;
 }