Esempio n. 1
0
 protected DataCountContextBase(IDataAccess dataAccess, string name, ICondition condition, string member, IDictionary <string, object> states = null) : base(dataAccess, name, DataAccessMethod.Count, states)
 {
     _condition     = condition;
     _member        = member;
     this.Entity    = DataContextUtility.GetEntity(name, dataAccess.Metadata);
     this.Validator = dataAccess.Validator;
 }
Esempio n. 2
0
 protected DataAggregateContextBase(IDataAccess dataAccess, string name, DataAggregate aggregate, ICondition criteria, IDictionary <string, object> states = null) : base(dataAccess, name, DataAccessMethod.Aggregate, states)
 {
     _condition     = criteria;
     this.Aggregate = aggregate;
     this.Entity    = DataContextUtility.GetEntity(name, dataAccess.Metadata);
     this.Validator = dataAccess.Validator;
 }
Esempio n. 3
0
        protected DataIncrementContextBase(IDataAccess dataAccess, string name, string member, ICondition condition, int interval = 1, IDictionary <string, object> states = null) : base(dataAccess, name, DataAccessMethod.Increment, states)
        {
            if (string.IsNullOrEmpty(member))
            {
                throw new ArgumentNullException(nameof(member));
            }

            if (condition == null)
            {
                throw new ArgumentNullException(nameof(condition));
            }

            _member        = member;
            _interval      = interval;
            _condition     = condition ?? throw new ArgumentNullException(nameof(condition));
            this.Entity    = DataContextUtility.GetEntity(name, dataAccess.Metadata);
            this.Validator = dataAccess.Validator;
        }
Esempio n. 4
0
 protected DataExistContextBase(IDataAccess dataAccess, string name, ICondition criteria, IDataExistsOptions options = null) : base(dataAccess, name, DataAccessMethod.Exists, options ?? new DataExistsOptions())
 {
     this.Criteria = criteria;
     this.Entity   = DataContextUtility.GetEntity(name, dataAccess.Metadata);
 }