private void Validate()
        {
            var errors = new List <string>();

            if (StockId == Guid.Empty)
            {
                errors.Add("StockId must be provided.");
            }
            if (AppUserId == Guid.Empty)
            {
                errors.Add("AppUserId must be provided.");
            }
            if (string.IsNullOrWhiteSpace(Name))
            {
                errors.Add("Alert Definition Name must be provided.");
            }
            if (RootCriteria == null)
            {
                errors.Add("Alert Definition must have a root criteria.");
            }

            RootCriteria.Validate(errors);

            if (errors.Any())
            {
                throw new BadRequestException(string.Join(Environment.NewLine, errors));
            }
        }
 private void DataPortal_Fetch(RootCriteria criteria)
 {
     // TODO: create data reader to load values
     using (SqlDataReader dr = null)
     {
         DoFetch(dr);
     }
 }
Esempio n. 3
0
 private void DataPortal_Fetch(RootCriteria criteria)
 {
     using (this.BypassPropertyChecks)
     {
         this.ReferenceType           = criteria.ReferenceType;
         this.ReferenceTypeNotAString = criteria.ReferenceTypeNotAString;
         this.ValueType = criteria.ValueType;
         this.Child     = ChildObject.Fetch(criteria.ReferenceType, criteria.ValueType);
     }
 }
 private void DataPortal_Delete(RootCriteria criteria)
 {
     // TODO: delete values
 }
 private void DataPortal_Create(RootCriteria criteria)
 {
     DoCreate();
 }
 public bool ContainsAlertCriteriaId(Guid alertCriteriaId) =>
 RootCriteria.ContainsAlertCriteriaId(alertCriteriaId);