Ejemplo n.º 1
0
 public static IQueryable <Port> Include(this IQueryable <Port> query, PortInclude include)
 {
     if (include.HasFlag(PortInclude.Node))
     {
         query = query.Include(x => x.Node);
     }
     if (include.HasFlag(PortInclude.NodeAggregatedData))
     {
         query = query.Include(x => x.Node.AggregatedData);
     }
     return(query);
 }
Ejemplo n.º 2
0
 public async Task <T> ByNodeIdAndPortNumberAsync <T>(int nodeId, int portNumber, PortInclude includes) where T : Port
 {
     return(await _ctx.Ports
            .Include(includes)
            .OfType <T>()
            .SingleOrDefaultAsync(p => p.NodeId == nodeId && p.PortNumber == portNumber));
 }
Ejemplo n.º 3
0
 public async Task <Port> ByNodeIdAndPortNumberAsync(int nodeId, int portNumber, PortInclude includes)
 {
     return(await _ctx.Ports
            .Include(includes)
            .SingleOrDefaultAsync(p => p.NodeId == nodeId && p.PortNumber == portNumber));
 }
Ejemplo n.º 4
0
 public async Task <Port> ByNodeRfAndPortNumberAsyn(int rfAddress, byte portNumber, PortInclude includes)
 {
     return(await _ctx.Ports
            .Include(includes)
            .SingleOrDefaultAsync(p => p.Node.RfAddress == rfAddress && p.PortNumber == portNumber));
 }