public WatchlistsService(IWatchlistsAPI watchlistsApi, ICompaniesAPI companiesApi, IRuleOneAPI ruleOneApi, IMapper mapper) { _watchlistsApi = watchlistsApi; _companiesApi = companiesApi; _ruleOneApi = ruleOneApi; _mapper = mapper; }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='company'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Company> CreateCompanyAsync(this ICompaniesAPI operations, Company company = default(Company), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateCompanyWithHttpMessagesAsync(company, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
public PortfoliosService(IPortfoliosAPI portfoliosApi, ICompaniesAPI companiesApi, IRuleOneAPI ruleOneApi, IMapper mapper) { _portfoliosApi = portfoliosApi; _companiesApi = companiesApi; _ruleOneApi = ruleOneApi; _mapper = mapper; }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='page'> /// </param> /// <param name='display'> /// </param> /// <param name='orderBy'> /// </param> /// <param name='q'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <PageCompany> GetPageOfCompaniesAsync(this ICompaniesAPI operations, int?page = default(int?), int?display = default(int?), string orderBy = default(string), string q = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetPageOfCompaniesWithHttpMessagesAsync(page, display, orderBy, q, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IList <Company> > GetAllCompaniesAsync(this ICompaniesAPI operations, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetAllCompaniesWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='symbol'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Company> GetCompanyAsync(this ICompaniesAPI operations, string symbol, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetCompanyWithHttpMessagesAsync(symbol, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
public CompaniesControllerShould() { var builder = new ConfigurationBuilder() .AddJsonFile("testsettings.json", optional: true, reloadOnChange: true) .AddEnvironmentVariables(); _configuration = builder.Build(); client = new CompaniesAPI(new Uri(_configuration["Client:Url"], UriKind.Absolute)); }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='company'> /// </param> public static Company CreateCompany(this ICompaniesAPI operations, Company company = default(Company)) { return(Task.Factory.StartNew(s => ((ICompaniesAPI)s).CreateCompanyAsync(company), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='page'> /// </param> /// <param name='display'> /// </param> /// <param name='orderBy'> /// </param> /// <param name='q'> /// </param> public static PageCompany GetPageOfCompanies(this ICompaniesAPI operations, int?page = default(int?), int?display = default(int?), string orderBy = default(string), string q = default(string)) { return(Task.Factory.StartNew(s => ((ICompaniesAPI)s).GetPageOfCompaniesAsync(page, display, orderBy, q), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <param name='operations'> /// The operations group for this extension method. /// </param> public static IList <Company> GetAllCompanies(this ICompaniesAPI operations) { return(Task.Factory.StartNew(s => ((ICompaniesAPI)s).GetAllCompaniesAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='symbol'> /// </param> public static Company GetCompany(this ICompaniesAPI operations, string symbol) { return(Task.Factory.StartNew(s => ((ICompaniesAPI)s).GetCompanyAsync(symbol), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='id'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task DeleteCompanyAsync(this ICompaniesAPI operations, Guid id, CancellationToken cancellationToken = default(CancellationToken)) { await operations.DeleteCompanyWithHttpMessagesAsync(id, null, cancellationToken).ConfigureAwait(false); }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='id'> /// </param> public static void DeleteCompany(this ICompaniesAPI operations, Guid id) { Task.Factory.StartNew(s => ((ICompaniesAPI)s).DeleteCompanyAsync(id), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); }
public CompaniesService(ICompaniesAPI companiesApi, IRuleOneAPI ruleOneApi, IMapper mapper) { _companiesApi = companiesApi; _ruleOneApi = ruleOneApi; _mapper = mapper; }