-
C#樹林
[C#] How to Log SQL Executed by EF Core to the Console
Overview This implementation allows you to visualize the SQL commands that Entity Framework Core (EF Core) executes in the background. This is useful for debugging and performance analysis. By using the LogTo method in the DbContext conf... -
C#樹林
【C#】EF Coreが実行するSQLをコンソールに出力して確認する方法
概要 Entity Framework Core (EF Core) が裏側でどのようなSQLを発行しているかを可視化し、デバッグやパフォーマンス分析を行うための実装です。 DbContext の設定で LogTo メソッドを使用し、標準出力(コンソール)にリアルタイムでクエリ情報を流しま... -
C#樹林
[C#] How to Set Command Timeout in Entity Framework Core
Overview This article explains how to set the waiting time (timeout) for Entity Framework Core (EF Core) when executing SQL against a database. By extending the timeout value, you can prevent intentional disconnections (TimeoutException)... -
Linux樹林
【C#】EF Coreでコマンドタイムアウト値を設定する方法
概要 Entity Framework Core (EF Core) がデータベースに対してSQLを実行する際の待機時間(タイムアウト)を設定する方法です。 デフォルト(通常30秒)よりも長い時間がかかる集計処理や一括更新処理を行う場合に、意図的な切断(TimeoutException)を防... -
Linux樹林
[Linux] Efficiently Changing Directories with the cd Command
Overview The cd (change directory) command is a shell built-in tool used to change your current working directory. The Linux file system is organized in a tree structure. To perform file operations or execute commands, you must be able t... -
Linux樹林
【Linux】cdコマンドで作業ディレクトリを効率的に移動する
概要 cd(change directory)は、現在作業している場所(カレントディレクトリ)を変更するためのシェル組み込みコマンドです。 Linuxのファイルシステムはツリー構造になっており、ファイル操作やコマンド実行を行うには、適切なディレクトリへの移動が不... -
Linux樹林
[Linux] Visualizing Directory Structures as a Tree with the tree Command
Overview The tree command is a tool that displays the hierarchical structure of files and subdirectories in a visual "tree" format. Unlike the recursive listing of ls -R, which can be hard to follow, tree allows you to understand the ent... -
Linux樹林
【Linux】treeコマンドでディレクトリ構造をツリー状に可視化する
概要 treeコマンドは、ディレクトリ内のファイルやサブディレクトリの階層構造を、視覚的な「木構造(ツリー)」として表示するツールです。 ls -Rなどの再帰的なリスト表示では把握しにくいフォルダの全体像や、ファイルの配置関係を一目で理解するのに役... -
Linux樹林
[Linux] List, Sort, and Filter Files Using the ls Command
Overview The ls (list segments) command is one of the most frequently used tools in Linux. It lists the files and subdirectories within a directory. Beyond just listing names, it allows you to check detailed information such as permissio... -
Linux樹林
【Linux】lsコマンドでファイル一覧を表示・ソート・フィルタリングする
概要 ls(list segments)は、ディレクトリ内のファイルやサブディレクトリの一覧を表示する、Linuxで最も頻繁に使用されるコマンドの一つです。 単に名前を列挙するだけでなく、ファイルの詳細情報(権限、所有者、サイズ、更新日時)を確認したり、表示... -
Linux樹林
[Linux] Interactively Editing Text Files with the ed Command (Line Editor)
Overview The ed command is a standard line editor that has existed since the early days of UNIX. Unlike screen editors such as vi or nano, it does not display the entire file on the screen. Instead, you perform editing operations "line-b... -
Linux樹林
【Linux】edコマンドでテキストファイルを対話的に編集する(ラインエディタ)
概要 edコマンドは、UNIXの初期から存在する標準的なラインエディタです。viやnanoのようなスクリーンエディタとは異なり、ファイル全体を画面に表示せず、コマンドを用いて「行単位」で編集操作を行います。 現代では日常的な編集に使われることは稀です... -
Linux樹林
[Linux] Using the lv Command to Automatically Detect Character Encodings for Viewing and Converting Text
Overview lv (Large View) is a powerful, multilingual file viewer (pager). While it feels similar to the less command, its standout feature is the ability to automatically detect and convert character encodings like UTF-8, Shift_JIS, and ... -
Linux樹林
【Linux】lvコマンドで文字コードを自動判別してテキストを表示・変換する
概要 lv(Large View)は、多言語対応の強力なファイルビューアー(ページャー)です。 lessコマンドと操作感は似ていますが、最大の特徴は日本語などの文字コード(UTF-8, Shift_JIS, EUC-JP等)を強力に自動判別・変換して表示できる点です。 Windowsで... -
Linux樹林
[Linux] Efficiently Viewing and Searching Text Files with the less Command
Overview The less command is a "pager" used to view the contents of a text file. Unlike the cat command, it does not read the entire file at once. It only displays the parts you are viewing. This means you can open very large log files (... -
Linux樹林
【Linux】lessコマンドでテキストファイルを効率的に閲覧・検索する
概要 lessコマンドは、テキストファイルの内容を閲覧するためのページャー(Pager)です。catコマンドとは異なり、ファイル全体を一度に読み込まずに必要な部分だけを表示するため、数GB単位の巨大なログファイルであってもメモリを消費せずに瞬時に開くこ... -
未分類
[C#] How to Implement Optimistic Concurrency Control with Entity Framework Core
Overview This implementation pattern prevents the "last-one-wins" problem in Entity Framework Core (EF Core) when multiple users update the same data at the same time. For data where consistency is critical, such as inventory management ... -
C#樹林
【C#】EF Coreでオプティミスティック同時実行制御(排他制御)を行う方法
概要 Entity Framework Core (EF Core) で、複数のユーザーが同時に同じデータを更新した際の「後勝ち(上書き)」を防ぐ実装パターンです。 在庫管理や座席予約など、整合性が重要なデータに対し、[Timestamp] 属性を用いた行バージョン管理を行うことで... -
C#樹林
[C#] Speeding Up Read-Only Data Retrieval with Entity Framework Core
Overview When you only need to display data without updating it in Entity Framework Core (EF Core), you can significantly improve performance by using the AsNoTracking method. This method skips the "Change Tracking" snapshot process perf... -
C#樹林
【C#】EF Coreで読み取り専用データの取得を高速化する方法
概要 Entity Framework Core (EF Core) でデータを表示するだけの(更新を行わない)場合、AsNoTracking メソッドを使用することでパフォーマンスを劇的に向上させることができます。 これにより、DbContextが行う「変更追跡(Change Tracking)」のスナッ... -
C#樹林
[C#] How to Explicitly Control Transactions in Entity Framework Core
Overview In Entity Framework Core (EF Core), you may want to group multiple SaveChanges calls into a single atomic operation. By using Database.BeginTransactionAsync, you can ensure that if an error occurs mid-process, all changes are ro... -
C#樹林
【C#】EF Coreでトランザクションを明示的に制御する方法
概要 Entity Framework Core (EF Core) において、複数の SaveChanges 呼び出しをひとつの不可分な処理(アトミックな操作)としてまとめ上げる方法です。 Database.BeginTransactionAsync を使用することで、途中でエラーが発生した場合に全ての変更をロ... -
C#樹林
[C#] Executing Raw SQL in EF Core (ExecuteSql / FromSql)
Overview This implementation shows how to execute SQL commands directly instead of using LINQ. This is useful for performance tuning or writing complex queries that are difficult to express in LINQ. You use ExecuteSqlAsync for updating d... -
C#樹林
【C#】EF Coreで生のSQLを実行する(ExecuteSql / FromSql)
概要 Entity Framework Core (EF Core) を使用しつつ、パフォーマンス調整や複雑なクエリ記述のために、LINQではなく直接SQL文を実行する方法です。 データの更新系には ExecuteSqlAsync、取得系には FromSql を使用し、C#の文字列補間($)を使うことでSQ... -
C#樹林
[C#] Updating Data Without Loading from the Database (Attach / Entry) in EF Core
Overview This is a performance-oriented implementation pattern in Entity Framework Core (EF Core) that allows you to perform an UPDATE without first executing a SELECT query. If the primary key (ID) is already known, you can use the Atta... -
C#樹林
【C#】EF Coreでデータを読み込まずに更新する方法(Attach / Entry)
概要 Entity Framework Core (EF Core) で、データベースからレコードを取得(SELECT)せずに、更新(UPDATE)だけを実行するパフォーマンス重視の実装パターンです。 主キー(ID)が既知の場合、Attach メソッドを使用してエンティティを追跡状態にし、変... -
C#樹林
[C#] How to Delete Rows with Entity Framework Core
Overview This implementation explains how to physically delete a specific record (row) from a database using Entity Framework Core (EF Core). By retrieving the target data, passing it to the Remove method, and calling SaveChangesAsync, a... -
C#樹林
【C#】Entity Framework Coreでテーブルの行を削除する方法
概要 Entity Framework Core (EF Core) を使用して、データベースから特定のレコード(行)を物理削除する基本的な実装です。 対象のデータを取得して Remove メソッドに渡し、SaveChangesAsync を呼び出すことで、データベースに対して DELETE SQLが発行... -
C#樹林
[C#] Updating Table Data with Entity Framework Core
Overview This is the basic implementation pattern for modifying and committing changes to existing records in a database using Entity Framework Core (EF Core). By leveraging the "Change Tracking" feature, you only need to update the prop... -
C#樹林
【C#】Entity Framework Coreでテーブルのデータを更新する
概要 Entity Framework Core (EF Core) を使用して、データベース内の既存レコードを変更し、確定(コミット)する基本的な実装パターンです。 EF Core の「変更追跡(Change Tracking)」機能を利用し、オブジェクトのプロパティを書き換えて SaveChanges...