public async Task <DataActionResult <IEnumerable <Profile> > > GetAllProfiles()
 {
     return(FailOrConvert(
                await Repo.GetAllProfiles(),
                profiles => profiles.Select(p => _efToViewConverter.Convert(p))
                ));
 }
 public async Task <DataActionResult <IEnumerable <CustomWebService> > > GetAllCws()
 {
     return(FailOrConvert(
                await Repo.GetAllCws(),
                enM => enM.Select(m => _efToViewConverter.Convert(m))
                ));
 }
 public async Task <DataActionResult <IEnumerable <NodeTag> > > GetAllTags()
 {
     return(FailOrConvert(
                await Repo.GetAllTags(),
                tags => tags.Select(t => _efToViewConverter.Convert(t))
                ));
 }
Ejemplo n.º 4
0
        public async Task <DataActionResult <MonitoringSession> > GetNewSession(
            int profileId
            )
        {
            StatusMessage profIdValidationStatus =
                await ValidateProfileId(profileId);

            if (profIdValidationStatus.Failure())
            {
                return(DataActionResult <MonitoringSession> .Failed(profIdValidationStatus));
            }

            return(FailOrConvert(
                       await Repo.GetNewSession(profileId),
                       session => _efToViewConverter.Convert(session)
                       ));
        }
Ejemplo n.º 5
0
 public async Task <DataActionResult <AllNodesData> > GetAllNodesData()
 {
     return(FailOrConvert(
                await Repo.GetAllNodesData(),
                nodesData => new AllNodesData()
     {
         WebServicesData = nodesData.WebServicesData,
         NodesData = nodesData.NodesData
                     .Select(ndGroup => ndGroup
                             .Select(nd => new NodeData()
         {
             Node = _efToViewConverter.Convert(nd.Node),
             BoundWebServicesIDs = nd.BoundWebServicesIDs,
             TagsIDs = nd.TagsIDs
         })
                             )
                     .ToList()
     }
                ));
 }