public TechObject TechObjectFromDb(DbTechObject theDbData) { var config = new MapperConfiguration(cfg => cfg.CreateMap <DbTechObject, TechObject>()); var mapper = new Mapper(config); var model = mapper.Map <TechObject>(theDbData); return(model); }
public long?InsertTech(SQLiteConnection theConnection, DbTechObject objectToSave) { long?result = null; try { result = theConnection.Insert(objectToSave); } catch (Exception) { theConnection.Close(); throw; } return(result); }
public long?InsertTech(DbTechObject objectToSave) { try { var sQLiteConnection = new SQLiteConnection(this._connectionString); sQLiteConnection.Open(); var result = InsertTech(sQLiteConnection, objectToSave); sQLiteConnection.Close(); return(result); } catch (Exception) { throw; } }