Example #1
0
 //        public T Create <T>(T model) where T : class
 //        {
 //            using (var c = new Mono.Data.Sqlite.SqliteConnection(Database.ConnectionString)) {
 //                c.Insert<T>(model);
 //            }
 //            return model;
 //        }
 public void Create(Curso model)
 {
     using (var c = new Mono.Data.Sqlite.SqliteConnection(Database.ConnectionString)) {
         c.Open();
         var m = model.ToDynamic();
         m.SetorId = model.Setor.Id;
         (m as IDictionary<string, object>).Remove("Setor");
         c.Insert((object)m, "Curso");
     }
 }