Exemple #1
0
    internal Task <IResult> GetApplications(IGetVendorsQuery getVendorsAndApplicationsQuery, IMapper mapper)
    {
        var vendors      = getVendorsAndApplicationsQuery.Execute();
        var applications = new List <ApplicationModel>();

        foreach (var vendor in vendors)
        {
            applications.AddRange(mapper.Map <List <ApplicationModel> >(vendor.Applications));
        }
        return(Task.FromResult(AdminApiResponse <List <ApplicationModel> > .Ok(applications)));
    }
Exemple #2
0
    internal Task <IResult> GetApplication(GetApplicationByIdQuery getApplicationByIdQuery, IMapper mapper, int id)
    {
        var application = getApplicationByIdQuery.Execute(id);

        if (application == null)
        {
            throw new NotFoundException <int>("application", id);
        }
        var model = mapper.Map <ApplicationModel>(application);

        return(Task.FromResult(AdminApiResponse <ApplicationModel> .Ok(model)));
    }
Exemple #3
0
    internal Task <IResult> GetVendor(IGetVendorByIdQuery getVendorByIdQuery, IMapper mapper, int id)
    {
        var vendor = getVendorByIdQuery.Execute(id);

        if (vendor == null)
        {
            throw new NotFoundException <int>("vendor", id);
        }
        var model = mapper.Map <VendorModel>(vendor);

        return(Task.FromResult(AdminApiResponse <VendorModel> .Ok(model)));
    }
Exemple #4
0
    internal Task <IResult> GetVendorApplications(GetApplicationsByVendorIdQuery getApplicationByVendorIdQuery, IMapper mapper, int id)
    {
        var vendorApplications = mapper.Map <List <ApplicationModel> >(getApplicationByVendorIdQuery.Execute(id));

        return(Task.FromResult(AdminApiResponse <List <ApplicationModel> > .Ok(vendorApplications)));
    }
Exemple #5
0
    internal Task <IResult> GetVendors(IGetVendorsQuery getVendorsQuery, IMapper mapper)
    {
        var vendorList = mapper.Map <List <VendorModel> >(getVendorsQuery.Execute());

        return(Task.FromResult(AdminApiResponse <List <VendorModel> > .Ok(vendorList)));
    }
    internal Task <IResult> GetClaimSets(GetClaimSetNamesQuery getClaimSetsQuery)
    {
        var calimSets = getClaimSetsQuery.Execute().ToList();

        return(Task.FromResult(AdminApiResponse <List <string> > .Ok(calimSets)));
    }