// 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"); } }
public bool Delete(Curso model) { using (var c = new Mono.Data.Sqlite.SqliteConnection(Database.ConnectionString)) { return c.Delete (model); } }
public bool Update(Guid id, Curso newT) { throw new NotImplementedException (); }
public bool Update(Curso oldT, Curso newT) { throw new NotImplementedException (); }
public bool Update(Curso entity) { using (var c = new Mono.Data.Sqlite.SqliteConnection(Database.ConnectionString)) { return c.Update<Curso>(entity); } }
public static bool Update(Curso curso) { var dao = TinyIoCContainer.Current.Resolve<DataFacade>(); return dao.UpdateCurso(curso); }
// public static Curso Insert(Curso colaborador) // { // var dao = TinyIoCContainer.Current.Resolve<DataFacade>(); // return dao.CreateCurso(colaborador); // } public static void Insert(Curso curso) { var dao = TinyIoCContainer.Current.Resolve<DataFacade>(); dao.CreateCurso(curso); }