/// <summary>
 /// Gets the value of one of this object's properties.
 /// </summary>
 protected virtual object GetValue(Restrike.GitHubIntegration.EFDAL.Entity.ConfigSetting.FieldNameConstants field, object defaultValue)
 {
     if (field == Restrike.GitHubIntegration.EFDAL.Entity.ConfigSetting.FieldNameConstants.ID)
     {
         return(this.ID);
     }
     if (field == Restrike.GitHubIntegration.EFDAL.Entity.ConfigSetting.FieldNameConstants.Name)
     {
         return(this.Name);
     }
     if (field == Restrike.GitHubIntegration.EFDAL.Entity.ConfigSetting.FieldNameConstants.Text)
     {
         return(this.Text);
     }
     if (field == Restrike.GitHubIntegration.EFDAL.Entity.ConfigSetting.FieldNameConstants.CreatedBy)
     {
         return((this.CreatedBy == null) ? defaultValue : this.CreatedBy);
     }
     if (field == Restrike.GitHubIntegration.EFDAL.Entity.ConfigSetting.FieldNameConstants.CreatedDate)
     {
         return(this.CreatedDate);
     }
     if (field == Restrike.GitHubIntegration.EFDAL.Entity.ConfigSetting.FieldNameConstants.ModifiedBy)
     {
         return((this.ModifiedBy == null) ? defaultValue : this.ModifiedBy);
     }
     if (field == Restrike.GitHubIntegration.EFDAL.Entity.ConfigSetting.FieldNameConstants.ModifiedDate)
     {
         return(this.ModifiedDate);
     }
     throw new Exception("Field '" + field.ToString() + "' not found!");
 }
        /// <summary>
        /// Gets the maximum size of the field value.
        /// </summary>
        public static int GetMaxLength(Restrike.GitHubIntegration.EFDAL.Entity.ConfigSetting.FieldNameConstants field)
        {
            switch (field)
            {
            case Restrike.GitHubIntegration.EFDAL.Entity.ConfigSetting.FieldNameConstants.ID:
                return(0);                        //Type=Int

            case Restrike.GitHubIntegration.EFDAL.Entity.ConfigSetting.FieldNameConstants.Name:
                return(MaxLengthValues.Name);

            case Restrike.GitHubIntegration.EFDAL.Entity.ConfigSetting.FieldNameConstants.Text:
                return(int.MaxValue);
            }
            return(0);
        }
 /// <summary>
 /// Assigns a value to a field on this object.
 /// </summary>
 /// <param name="field">The field to set</param>
 /// <param name="newValue">The new value to assign to the field</param>
 /// <param name="fixLength">Determines if the length should be truncated if too long. When false, an error will be raised if data is too large to be assigned to the field.</param>
 protected virtual void SetValue(Restrike.GitHubIntegration.EFDAL.Entity.ConfigSetting.FieldNameConstants field, object newValue, bool fixLength)
 {
     if (field == Restrike.GitHubIntegration.EFDAL.Entity.ConfigSetting.FieldNameConstants.ID)
     {
         throw new Exception("Field '" + field.ToString() + "' is a primary key and cannot be set!");
     }
     else if (field == Restrike.GitHubIntegration.EFDAL.Entity.ConfigSetting.FieldNameConstants.Name)
     {
         this.Name = GlobalValues.SetValueHelperInternal((string)newValue, fixLength, GetMaxLength(field));
     }
     else if (field == Restrike.GitHubIntegration.EFDAL.Entity.ConfigSetting.FieldNameConstants.Text)
     {
         this.Text = GlobalValues.SetValueHelperInternal((string)newValue, fixLength, GetMaxLength(field));
     }
     else
     {
         throw new Exception("Field '" + field.ToString() + "' not found!");
     }
 }
 /// <summary>
 /// Assigns a value to a field on this object.
 /// </summary>
 /// <param name="field">The field to set</param>
 /// <param name="newValue">The new value to assign to the field</param>
 protected virtual void SetValue(Restrike.GitHubIntegration.EFDAL.Entity.ConfigSetting.FieldNameConstants field, object newValue)
 {
     SetValue(field, newValue, false);
 }
 /// <summary>
 /// Gets the value of one of this object's properties.
 /// </summary>
 protected virtual object GetValue(Restrike.GitHubIntegration.EFDAL.Entity.ConfigSetting.FieldNameConstants field)
 {
     return(GetValue(field, null));
 }