ユーザ用ツール

サイト用ツール


サイドバー

dotnet:webapiチュートリアル

以前のリビジョンの文書です


webapiチュートリアル

コンテナの起動

Todoアプリを作成するのは以下のコンテナ。

Dcokerfile
FROM mcr.microsoft.com/dotnet/sdk:6.0

dotnet-aspnet-codegenerator: command not found

このエラーがでてスキャフォールディングができない。

dotnet tool install -g dotnet-aspnet-codegenerator

の後に

> cat << \EOF >> ~/.bash_profile
# Add .NET Core SDK tools
export PATH="$PATH:/roo/.dotnet/tools"

> export PATH="$PATH:/root/.donet/tools"

を入力する

# dotnet-aspnet-codegenerator controller -name TodoItemsController -async -api -m TodoItem -dc TodoContext -outDir Controllers
Building project ...
Finding the generator 'controller'...
Running the generator 'controller'...

Minimal hosting scenario!
Attempting to compile the application in memory.
Attempting to figure out the EntityFramework metadata for the model and DbContext: 'TodoItem'
info: Microsoft.EntityFrameworkCore.Infrastructure[10403]
      Entity Framework Core 6.0.8 initialized 'TodoContext' using provider 'Microsoft.EntityFrameworkCore.InMemory:6.0.8' with options: StoreName=TodoList 
Added Controller : '/Controllers/TodoItemsController.cs'.
RunTime 00:00:09.35
dotnet/webapiチュートリアル.1662008466.txt.gz · 最終更新: 2022/09/01 14:01 by ips