Пример #1
0
 public static NotNullConstraintViolationException New(SQLiteException exception, TableMapping mapping,
                                                       object obj)
 {
     return(new NotNullConstraintViolationException(exception.Result, exception.Message, mapping, obj));
 }
Пример #2
0
 protected NotNullConstraintViolationException(SQLite3.Result r, string message, TableMapping mapping,
                                               object obj) : base(r, message)
 {
     if (mapping != null && obj != null)
     {
         this.Columns = from c in mapping.Columns
                        where c.IsNullable == false && c.GetValue(obj) == null
                        select c;
     }
 }
Пример #3
0
 public static NotNullConstraintViolationException New(SQLite3.Result r, string message, TableMapping mapping,
                                                       object obj)
 {
     return(new NotNullConstraintViolationException(r, message, mapping, obj));
 }
Пример #4
0
 private TableQuery(SQLiteConnection conn, TableMapping table)
 {
     this.Connection = conn;
     this.Table      = table;
 }
Пример #5
0
 public TableQuery(SQLiteConnection conn)
 {
     this.Connection = conn;
     this.Table      = this.Connection.GetMapping(typeof(T));
 }
Пример #6
0
 public List <T> ExecuteQuery <T>(TableMapping map)
 {
     return(ExecuteDeferredQuery <T>(map).ToList());
 }
Пример #7
0
 public object Find(object pk, TableMapping map)
 {
     return(Query(map, map.GetByPrimaryKeySQL, pk).FirstOrDefault());
 }
Пример #8
0
        public T Find <T>(object pk) where T : new()
        {
            TableMapping map = GetMapping(typeof(T));

            return(Query <T>(map.GetByPrimaryKeySQL, pk).FirstOrDefault());
        }
Пример #9
0
        public IEnumerable <object> DeferredQuery(TableMapping map, string query, params object[] args)
        {
            SQLiteCommand cmd = CreateCommand(query, args);

            return(cmd.ExecuteDeferredQuery <object>(map));
        }
Пример #10
0
        public List <object> Query(TableMapping map, string query, params object[] args)
        {
            SQLiteCommand cmd = CreateCommand(query, args);

            return(cmd.ExecuteQuery <object>(map));
        }