public IEnumerable <Operation> Get(long goalId, GoalEntityType goalTypeId) { var sqlSelect = String.Format("SELECT * FROM {0} WHERE [GoalId] = @goalId AND [GoalTypeId] = @goalTypeId", EntityTableSchema); var entities = Connection.Query <Operation>(sqlSelect, new { goalId, goalTypeId }); return(entities); }
public Goal Get(long parentId, GoalEntityType parentTypeId) { var sql = String.Format("SELECT * FROM {0} WHERE ParentId = @id AND ParentTypeId = @typeId", EntityTableSchema); var entity = Connection.Query <Goal>(sql, new { id = parentId, typeId = (int)parentTypeId }).SingleOrDefault(); if (entity != null) { entity.OperationDetails = _operationRepository.Get(entity.ParentId, entity.ParentTypeId); } return(entity); }
public int OperationsPendingCount(long goalId, GoalEntityType goalTypeId) { throw new NotImplementedException(); }
public void Delete(long parentId, GoalEntityType parentTypeId) { var sql = String.Format("DELETE FROM {0} WHERE ParentId = @id AND ParentTypeId = @typeId", EntityTableSchema); Connection.Execute(sql, new { id = parentId, typeId = (int)parentTypeId }); }