
JavaScript
- 21 ответ
- 0 вопросов
8
Вклад в тег
/app/server_app.Domain/Model/Queries/ProductCategoryCreateQuery.cs(3,17): error CS0234: The type or namespace name 'AspNetCore' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [/app/server_app.Domain/server_app.Domain.csproj]
<ItemGroup>
<Reference Include="FluentValidation">
<HintPath>..\..\..\..\.nuget\packages\fluentvalidation\11.11.0\lib\net8.0\FluentValidation.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AspNetCore.Http.Abstractions">
<HintPath>..\..\..\..\.nuget\packages\microsoft.aspnetcore.app.ref\8.0.8\ref\net8.0\Microsoft.AspNetCore.Http.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AspNetCore.Http.Features">
<HintPath>..\..\..\..\.nuget\packages\microsoft.aspnetcore.app.ref\8.0.8\ref\net8.0\Microsoft.AspNetCore.Http.Features.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AspNetCore.Mvc.Abstractions">
<HintPath>..\..\..\..\.nuget\packages\microsoft.aspnetcore.app.ref\8.0.8\ref\net8.0\Microsoft.AspNetCore.Mvc.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AspNetCore.Mvc.Core">
<HintPath>..\..\..\..\.nuget\packages\microsoft.aspnetcore.app.ref\8.0.8\ref\net8.0\Microsoft.AspNetCore.Mvc.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Tokens">
<HintPath>..\..\..\..\.nuget\packages\microsoft.identitymodel.tokens\7.1.2\lib\net8.0\Microsoft.IdentityModel.Tokens.dll</HintPath>
</Reference>
<Reference Include="Npgsql.EntityFrameworkCore.PostgreSQL">
<HintPath>..\..\..\..\.nuget\packages\npgsql.entityframeworkcore.postgresql\9.0.2\lib\net8.0\Npgsql.EntityFrameworkCore.PostgreSQL.dll</HintPath>
</Reference>
</ItemGroup>
dotnet restore
их просто игнорирует. Эти зависимости должны быть в общем списке, как в блоке ItemGroup ниже этого, но проблема на самом деле куда глобальнее.Content-Type: application/json
class Category
{
private $children = null;
public function __get($property)
{
if ($property === 'children') {
if ($this->children !== null) return $this->children;
else {
$this->children = $this->getChildren();
return $this->children;
}
} else {
throw 'Undefined property';
}
}
private function getChildren()
{
// TODO: запрос к базе и получение результата
}
}
$category = new Category();
someAction($category->children); // в первый раз будет запрос
showSubCategories($category->children); // второй и послудеющий раз возьмёт уже из приватного поля