num=>num!=2
Ведь эта строка на много проще
var noTwo = nums.Where(x=>x != 2);
// или
var noTwo=from num in nums
where num!=2
select num;
var settings = new Tinkoff.InvestApi.InvestApiSettings
{
AccessToken = "..."
};
var client = Tinkoff.InvestApi.InvestApiClientFactory.Create(settings);
var currencies = client.Instruments.Currencies();
foreach (var currency in currencies.Instruments)
{
Console.WriteLine(
$"{currency.Uid} {currency.Ticker} {currency.Name} {currency.Nominal.Units + currency.Nominal.Nano / 1000000000m} {currency.Nominal.Currency}");
}
При запуске ide, сначала нужно собрать: shift + f10, следом каждый раз мне нужно нажимать ctrl + f5.
В гугле file watcher - там я могу указать только путь до .exe файла, это не то.
И как эти scoped объеты существуют в background сервисах?
"Создается один объект при его запросе в рамках некой области, например http запроса, и в последующем выдается уже созданный в рамках этой области". Часто получал утверждение что неправильно, и непонятно что за область
Scoped
For web applications, a scoped lifetime indicates that services are created once per client request (connection). Register scoped services with AddScoped.
In apps that process requests, scoped services are disposed at the end of the request.
When using Entity Framework Core, the AddDbContext extension method registers DbContext types with a scoped lifetime by default.
Note
Do not resolve a scoped service from a singleton and be careful not to do so indirectly, for example, through a transient service. It may cause the service to have incorrect state when processing subsequent requests. It's fine to:
- Resolve a singleton service from a scoped or transient service.
- Resolve a scoped service from another scoped or transient service.
By default, in the development environment, resolving a service from another service with a longer lifetime throws an exception. For more information, see Scope validation.
Или только консольные приложения доступны будут?
Мы вызываем нестатический метод в конструкторе, то есть экземпляра класса еще нет?
Nlog
SQLite