Exemplo n.º 1
0
 protected virtual DragonSession GetSessionRecord(Guid sessionID)
 {
     using (var conn = new SqlConnection(StandardSqlStore.ConnectionString))
     {
         conn.Open();
         return conn.QueryFor<DragonSession>(SQL.SqlSessionStore_Get, new { SessionID = sessionID }).FirstOrDefault();
     }
 }
Exemplo n.º 2
0
 protected override IEnumerable<IPermissionNode> EnumerateAllNodesInternal()
 {
     using (var conn = new SqlConnection(StandardSqlStore.ConnectionString))
     {
         conn.Open();
         var param = new {};
         return conn.QueryFor<DragonPermissionNode>(SQL.SqlPermissionStore_GetAllPermissionNodes, param);
     }
 }
Exemplo n.º 3
0
 protected override IEnumerable<IRegistration> LoadUser(Guid userID)
 {
     using (var conn = new SqlConnection(StandardSqlStore.ConnectionString))
     {
         conn.Open();
         var param = new { UserID = userID };
         return conn.QueryFor<DragonRegistration>(SQL.SqlUserStore_GetByUserID, param);
     }
 }
Exemplo n.º 4
0
 protected override IRegistration LoadRegistration(string service, string key)
 {
     using (var conn = new SqlConnection(StandardSqlStore.ConnectionString))
     {
         conn.Open();
         var param = new { Service = service, Key = key };
         return conn.QueryFor<DragonRegistration>(SQL.SqlUserStore_GetByServiceAndKey, param).FirstOrDefault();
     }
 }
Exemplo n.º 5
0
 protected override string GetPropertyInternal(Guid userID, string key)
 {
     using (var conn = new SqlConnection(StandardSqlStore.ConnectionString))
     {
         conn.Open();
         var param = new { UserID = userID, Key = key };
         var candidate = conn.QueryFor<DragonProfile>(SQL.SqlProfileStore_Get, param).FirstOrDefault();
         return candidate == null ? null : candidate.Value;
     }
 }
Exemplo n.º 6
0
 protected override IEnumerable<Guid> EnumerateChildrenNodesInternal(Guid parentID)
 {
     using (var conn = new SqlConnection(StandardSqlStore.ConnectionString))
     {
         conn.Open();
         var param = new { ParentID = parentID };
         return conn.QueryFor<DragonPermissionNode>(SQL.SqlPermissionStore_GetPermissionNodesByParentID, param)
             .Select(x=>x.ParentID);
     }
 }
Exemplo n.º 7
0
 protected override IEnumerable<IPermissionRight> EnumerateRightsInternal(Guid nodeID)
 {
     using (var conn = new SqlConnection(StandardSqlStore.ConnectionString))
     {
         conn.Open();
         var param = new { NodeID = nodeID };
         return conn.QueryFor<DragonPermissionRight>(SQL.SqlPermissionStore_GetPermissionRightsByNode, param);
     }
 }