Пример #1
0
 public bool Delete(Survey survey)
 {
     using (IDbConnection db = _factory.OpenDbConnection())
     {
         db.Delete<Survey>(survey);
         return true;
     }
 }
Пример #2
0
        public Survey Add(Survey survey)
        {
            using (IDbConnection db = _factory.OpenDbConnection())
            {
                db.Insert<Survey>(survey);

                survey.Id = db.GetLastInsertId();

                return survey;
            }
        }
Пример #3
0
 private long FirstSegmentId(Survey survey, IDbConnection db)
 {
     return db.QueryScalar<long>(@"SELECT TOP 1 Id FROM Segment WHERE SurveyId = @surveyId ORDER BY [Order],Id", new { surveyId = survey.Id });
 }
Пример #4
0
 public Survey Update(Survey survey)
 {
     using (IDbConnection db = _factory.OpenDbConnection())
     {
         db.Update<Survey>(survey);
         return survey;
     }
 }
Пример #5
0
 private Survey PopulateDerived(Survey survey, IDbConnection db)
 {
     survey.FirstSegmentId = FirstSegmentId(survey, db);
     return survey;
 }