コード例 #1
0
 internal IGNQueriable(IDataDriver dataDriver)
 {
     paramValues     = new List <IGNParameterValue>();
     this.dataDriver = dataDriver;
     canExecute      = true;
     exists          = true;
 }
コード例 #2
0
        private void Register(string name, IDataDriver <SourceContext> dataDriver)
        {
            var nodeDefinition = Attach(new NodeDefinition()
            {
                Name = name
            });

            _nodeDefinitionProvider.Register(name, nodeDefinition);
            _nodeRegistry.Register(name, new BaseNode <SourceContext>(dataDriver, _nodeDefinitionProvider.GetByName(name)));
        }
コード例 #3
0
        static void CheckDataDriver(IDataDriver driver)
        {
            string id       = driver.Create(new { name = "Fabricio" });
            object original = driver.Read(id);

            bool wasUpdated = driver.Update(id, new { height = 10, width = 10 });

            object modified = driver.Read(id);

            bool wasDeleted = driver.Delete(id);
        }
コード例 #4
0
 public string AsCreateTableQueryField(
     IDataDriver driver,
     GetDbTypeFunc getDbType,
     GetDefaultValueFunc getDefaultValue,
     GetDbAutoGenFunc getDbAutoGen)
 {
     return($"{SanitizeName(ColumnName, driver.Dialect)} {getDbType(ColumnType, Length, DecimalPositions)} " +
            $"{(Required ? "NOT NULL" : "NULL")}" +
            $"{getDefaultValue(Required, Generated, DefValue,driver.Dialect)}" +
            $"{getDbAutoGen(Generated, ColumnType, Length,driver)}");
 }
コード例 #5
0
 public static IGNQueriable Begin(string email, IDataDriver dataDriver)
 {
     Activation.Activate(email);
     if (Activation.IsActive)
     {
         return(new IGNQueriable(dataDriver));
     }
     else
     {
         throw new Exception("Please activate your copy of ignquery it's free of charge you just need to pass your email in constructor");
     }
 }
コード例 #6
0
 public static IGNQueriable FromQueryString(string query, string email, IDataDriver dataDriver)
 {
     Activation.Activate(email);
     if (Activation.IsActive)
     {
         return(new IGNQueriable(dataDriver)
         {
             fullQuery = query,
             exists = true,
             canExecute = true
         });
     }
     else
     {
         throw new Exception("Please activate your copy of ignquery it's free of charge you just need to pass your email in constructor");
     }
 }
コード例 #7
0
 private static string GetDbAutoGenFunc(bool generated,
                                        Type clrType, int length, IDataDriver driver)
 {
     return(generated ? driver.GetDbAutoGenFor(clrType, length) : "");
 }
コード例 #8
0
 public BaseNode(IDataDriver <TDataItem> driver, NodeDefinition nodeDefinition)
 {
     _driver         = driver;
     _nodeDefinition = nodeDefinition;
 }