public override void CompleteObject(Brokermqtt o, DataAccessLayer dal, bool completeRelatedObjects = true) { if (o == null) { throw new ArgumentNullException("brokermqtt"); } var dao = new BrokermqttDal(dal); var connOpened = dal.ConnectionOpened; try { dal.OpenConnection(!connOpened); dao.CompleteObject(o); CompleteRelatedObjects(o, dal); } catch (Exception ex) { throw ex; } finally { dal.CloseConnection(!connOpened); } }
public List <Brokermqtt> GetList() { using (var dal = DatabaseConnection.GetDataAccessLayer()) { var dao = new BrokermqttDal(dal); try { return(dao.GetList()); } catch (Exception ex) { throw ex; } } }
public void Delete(Brokermqtt o) { using (var dal = DatabaseConnection.GetDataAccessLayer()) { var dao = new BrokermqttDal(dal); try { dao.Delete(o); } catch (Exception ex) { throw ex; } } }
public List <Brokermqtt> GetList(string conditions = null, bool completeRelatedObjects = false) { using (var dal = DatabaseConnection.GetDataAccessLayer()) { var dao = new BrokermqttDal(dal); try { var list = dao.GetList(conditions); foreach (Brokermqtt p in list) { CompleteRelatedObjects(p, dal); } return(list); } catch (Exception ex) { throw ex; } } }
public Brokermqtt GetObject(int idBrokermqtt) { using (var dal = DatabaseConnection.GetDataAccessLayer()) { var dao = new BrokermqttDal(dal); try { dal.OpenConnection(); var teste = dao.GetObject(idBrokermqtt); CompleteRelatedObjects(teste, dal); return(teste); } catch (Exception ex) { throw ex; } finally { dal.CloseConnection(); } } }
public void Save(Brokermqtt o) { using (var dal = DatabaseConnection.GetDataAccessLayer()) { var dao = new BrokermqttDal(dal); try { if (!o.Persisted) { dao.Insert(o); } else { dao.Update(o); } } catch (Exception ex) { throw ex; } } }