⚙️

Visual Studio拡張機能を作ってみたので誰かに試してほしい記事

に公開

こんにちは。
なかなか楽しい開発生活を過ごさせていただいております。ボイラーです。

いままでコソコソと温めてきたオレオレVisual Studio拡張機能「boilersExtensions」に面白い機能を実装しました。この記事の趣旨としては、その面白機能を誰かに試してほしいなぁと思っております。

最近実装した機能

「#region/#endregion間を Ctrl + クリックでジャンプ」

Visual Studio 2022の標準機能では #region ディレクティブから対応する #endregion ディレクティブへ、また逆も同じく、ジャンプする方法がありませんでした。

当拡張機能では、これを可能とします。

https://youtu.be/M5zjCeJ0jnM

また、Ctrl + クリックでジャンプすることに抵抗を感じる人も少なからずいるかもしれないので、テキストエディタのコンテキストメニューに「#region/#endregion間を移動」メニューを用意しました。

「Seed Generator for EFCore」

C#界隈でObject Relational Mapper(ORM)のライブラリを挙げるといくつかありますが、そのうちの一つであるMicrosoft製、EntityFrameworkCore (以下、EFCore)は私もしばしば使います。データベースのテーブル構造を Database as Code(っていうんですかね?)で表現することができるEFCoreではありますが、Seedデータ(初期投入データ)を用意するのは面倒ですよね。特に、プライマリーキーや外部キーをGuid型で統一している時はとても面倒です。GUIDをGUID生成Webサイトで生成して、コピーして、貼り付ける。それを何箇所もやる羽目になります。Visual StudioにはGUIDを生成するためのツールがありますが、それを使ったとしても関係者各位のレコード1件1件に同じGUIDを貼ったり、違うGUIDを貼ったり、とっても忙しいんです!

私は真面目にGUIDを貼る巡業を続けるのを諦めて、この「Seed Generator for EFCore」を作ることを決めました。そしてできたのがこちらです。

https://youtu.be/dua4ubHVO2U

※現時点では、当Seed Generatorには複数の機能が混在しており、UI面であまり整理ができていません。今後のアップデートでタブコントロールではなくウィザード形式に変更する予定があります。あらかじめご了承ください。

上記の動画には

  1. エンティティを追加 https://youtu.be/dua4ubHVO2U?t=14
  2. エンティティ間のリレーション設定 https://youtu.be/dua4ubHVO2U?t=23
  3. 出力するデータ形式と出力先のクラス名指定 https://youtu.be/dua4ubHVO2U?t=42
  4. 実際に生成する https://youtu.be/dua4ubHVO2U?t=47

の手順でSeedデータ生成コードの出力が行われます。

エンティティを追加

エンティティ関連タブで操作することで、エンティティ間のリレーションを考慮したSeedデータ生成コードが出力できます。(スキーマ設定は1テーブルに対するSeedデータ生成コードの出力のみです)
まず「エンティティを追加」ボタンを押して、ファイルを開くダイアログから、Seedデータを生成したいエンティティクラスが含まれるファイルを開きます。ファイルを開くと、左側の白いリストにエンティティクラスが登録されていきます。
この操作をSeedデータが必要なだけエンティティクラスを登録します。

その後、エンティティクラスを選択すると、プロパティが画面中央で見られるので、プロパティ一覧を確認します。もし、あるプロパティに固定値を設定したい場合は、固定値カラムのボタンをクリックします。すると、「固定値の編集」ダイアログが出ます。

「固定値の編集」ダイアログには複数の値が設定できます。つまり、テキストボックス内の1行毎に認識されます。ダイアログを閉じると、このように「5個の値」として認識されます。

エンティティ間のリレーション設定

エンティティのプロパティを設定した後は、リレーションシップを設定します。
リレーションシップを設定すると、リレーションが結びついたプロパティ同士に同じ値が設定されるように出力されます。

つまり、

関係者各位のレコード1件1件に同じGUIDを貼ったり

みたいなことをSeed Generator for EFCoreがやってくれるので大変便利だと自負しています。

今回のサンプル出力では、

  • Project Id OneToMany Video ProjectId
  • Video Id OneToMany KeyPoint VideoId

みたいな指定の仕方をしています。

出力するデータ形式と出力先のクラス名指定

あとは「データ形式設定」タブで出力形式を選ぶだけです。データ形式は「C#クラス」「JSON配列」「CSV形式」「SQL INSERT文」「XML形式」と一応用意がありますが、実は「C#クラス」しか十分にテストをしていなかったりします。まあ、私も「C#クラス」でしか今のところ使わないので他の4つは後回しになっております。

「C#クラス」形式で出力とは既存のクラスに、Seedデータの投入コードを記載したGenerateSeedDataメソッドを追加するということです。一旦メソッドという形で出力してしまえば、後はユーザーの方々が煮るなり焼くなり好きにできるでしょう、ということですね。

実際に生成する

実際にコード生成してみるとこうなります。

以下はサンプルで出力した結果となります。プライマリーキーや外部キー、固定値を設定したプロパティ以外はダミーのランダムな値が入っています。このように、かけた時間の割には効率よくEFCore向けのSeedデータ投入コードが用意できるという感じです。

非常に長いサンプル出力コード
public static void GenerateSeedData(ModelBuilder modelBuilder)
{
    // ランダム生成用のインスタンスを定義
    var random = new Random();

    // Project エンティティのシードデータ
    modelBuilder.Entity<Project>().HasData(
        new Project
        {
            Name = "John",
            Description = "deserunt pariatur ullamco in nisi voluptate ut in excepteur officia ut eu sed consectetur labore con",
            LastPublished = new DateTime(2000, 4, 11, 20, 37, 54),
            OwnerUserId = new Guid("0871608d-1197-4484-f629-5e2bdad6b323"),
            Id = new Guid("f2559dc3-422f-7ac3-0d76-27a08d4d3f0a"),
            CreatedAt = new DateTime(2004, 5, 4, 2, 46, 35),
            UpdatedAt = new DateTime(2001, 2, 16, 21, 1, 29),
            IsDeleted = true
        },
        new Project
        {
            Name = "John",
            Description = "adipiscing in deserunt commodo excepteur nulla aute aliqua proident excepteur tempor laboris ea aliq",
            LastPublished = new DateTime(2023, 4, 24, 3, 47, 12),
            OwnerUserId = new Guid("0871608d-1197-4484-f629-5e2bdad6b323"),
            Id = new Guid("8c4a756e-1bcf-8839-005c-0421e62b625d"),
            CreatedAt = new DateTime(2023, 4, 29, 8, 21, 42),
            UpdatedAt = new DateTime(2010, 4, 18, 4, 53, 3),
            IsDeleted = true
        },
        new Project
        {
            Name = "Mary",
            Description = "sed duis ad sunt reprehenderit exercitation nisi dolore laboris est consectetur qui dolor enim paria",
            LastPublished = new DateTime(2003, 2, 27, 0, 22, 29),
            OwnerUserId = new Guid("0871608d-1197-4484-f629-5e2bdad6b323"),
            Id = new Guid("ca196bfe-9b02-31bc-8d5a-6e4c2d5aff5b"),
            CreatedAt = new DateTime(2010, 11, 26, 11, 32, 29),
            UpdatedAt = new DateTime(2003, 5, 15, 22, 16, 12),
            IsDeleted = false
        },
        new Project
        {
            Name = "Jackson",
            Description = "mollit anim esse nulla voluptate ea adipiscing magna voluptate voluptate sint incididunt id veniam r",
            LastPublished = new DateTime(2004, 4, 4, 3, 4, 17),
            OwnerUserId = new Guid("0871608d-1197-4484-f629-5e2bdad6b323"),
            Id = new Guid("2a11212d-8ffb-8a4e-5919-ae2b51032326"),
            CreatedAt = new DateTime(2008, 10, 4, 8, 12, 5),
            UpdatedAt = new DateTime(2003, 1, 8, 10, 4, 52),
            IsDeleted = false
        },
        new Project
        {
            Name = "Susan",
            Description = "consectetur duis officia eiusmod mollit laboris cupidatat est sint amet nostrud consequat in quis in",
            LastPublished = new DateTime(2018, 11, 21, 17, 41, 39),
            OwnerUserId = new Guid("0871608d-1197-4484-f629-5e2bdad6b323"),
            Id = new Guid("492ed409-5244-4823-d3be-a7f9e2ba3720"),
            CreatedAt = new DateTime(2023, 8, 22, 21, 21, 41),
            UpdatedAt = new DateTime(2003, 8, 28, 11, 21, 43),
            IsDeleted = false
        }
    );

    // Video エンティティのシードデータ
    modelBuilder.Entity<Video>().HasData(
        new Video
        {
            Title = "Data Analyst",
            Duration = 549958,
            FrameCount = 641623,
            TotalBytes = 80268,
            IsProcessed = false,
            Status = VideoStatus.Created,
            UploadingProgressPercent = 744.462214291311d,
            VideoDataFileLastPublishedDate = new DateTime(2011, 11, 30, 14, 18, 14),
            LabelDataFileLastPublishedDate = new DateTime(2015, 2, 4, 13, 42, 8),
            FileKey = "https://www.outlook.com",
            FileUri = "https://www.enterprise.org",
            LabelDataFileUri = "https://www.yahoo.com",
            VideoDataFileUri = "https://www.aol.com",
            ProjectId = new Guid("f2559dc3-422f-7ac3-0d76-27a08d4d3f0a"),
            Id = new Guid("47cd7eda-037a-d95b-21ab-aeebe13ef444"),
            CreatedAt = new DateTime(2004, 5, 4, 2, 46, 35),
            UpdatedAt = new DateTime(2001, 2, 16, 21, 1, 29),
            IsDeleted = true
        },
        new Video
        {
            Title = "Research Scientist",
            Duration = 576262,
            FrameCount = 802653,
            TotalBytes = 921143,
            IsProcessed = true,
            Status = VideoStatus.Uploading,
            UploadingProgressPercent = 672.122713957039d,
            VideoDataFileLastPublishedDate = new DateTime(2024, 5, 12, 10, 35, 16),
            LabelDataFileLastPublishedDate = new DateTime(2022, 10, 25, 14, 5, 51),
            FileKey = "https://www.example.com",
            FileUri = "https://www.university.edu",
            LabelDataFileUri = "https://www.company.com",
            VideoDataFileUri = "https://www.yahoo.com",
            ProjectId = new Guid("f2559dc3-422f-7ac3-0d76-27a08d4d3f0a"),
            Id = new Guid("7d0e24a0-1db0-76e6-591c-fda2cf761798"),
            CreatedAt = new DateTime(2023, 4, 29, 8, 21, 42),
            UpdatedAt = new DateTime(2010, 4, 18, 4, 53, 3),
            IsDeleted = true
        },
        new Video
        {
            Title = "UX Designer",
            Duration = 667074,
            FrameCount = 74497,
            TotalBytes = 227321,
            IsProcessed = true,
            Status = VideoStatus.Uploaded,
            UploadingProgressPercent = 338.931703166539d,
            VideoDataFileLastPublishedDate = new DateTime(2020, 4, 20, 22, 11, 7),
            LabelDataFileLastPublishedDate = null,
            FileKey = "https://www.gmail.com",
            FileUri = "https://www.aol.com",
            LabelDataFileUri = "https://www.company.com",
            VideoDataFileUri = "https://www.yahoo.com",
            ProjectId = new Guid("8c4a756e-1bcf-8839-005c-0421e62b625d"),
            Id = new Guid("8a20bba2-e5bf-a8c8-0496-6be666968d26"),
            CreatedAt = new DateTime(2010, 11, 26, 11, 32, 29),
            UpdatedAt = new DateTime(2003, 5, 15, 22, 16, 12),
            IsDeleted = false
        },
        new Video
        {
            Title = "Data Analyst",
            Duration = 977863,
            FrameCount = 691864,
            TotalBytes = 76036,
            IsProcessed = false,
            Status = VideoStatus.FastStartProcessing,
            UploadingProgressPercent = 775.953279703834d,
            VideoDataFileLastPublishedDate = new DateTime(2001, 5, 26, 4, 23, 33),
            LabelDataFileLastPublishedDate = new DateTime(2023, 11, 9, 23, 28, 32),
            FileKey = "https://www.company.com",
            FileUri = "https://www.icloud.com",
            LabelDataFileUri = "https://www.aol.com",
            VideoDataFileUri = "https://www.gmail.com",
            ProjectId = new Guid("8c4a756e-1bcf-8839-005c-0421e62b625d"),
            Id = new Guid("081ace4a-3751-7334-42e7-7beb5c6fbf4e"),
            CreatedAt = new DateTime(2008, 10, 4, 8, 12, 5),
            UpdatedAt = new DateTime(2003, 1, 8, 10, 4, 52),
            IsDeleted = false
        },
        new Video
        {
            Title = "Finance Director",
            Duration = 309105,
            FrameCount = 921450,
            TotalBytes = 812674,
            IsProcessed = true,
            Status = VideoStatus.FastStartProcessed,
            UploadingProgressPercent = 533.425098533474d,
            VideoDataFileLastPublishedDate = new DateTime(2000, 1, 28, 18, 15, 33),
            LabelDataFileLastPublishedDate = new DateTime(2002, 3, 29, 15, 51, 53),
            FileKey = "https://www.company.com",
            FileUri = "https://www.aol.com",
            LabelDataFileUri = "https://www.icloud.com",
            VideoDataFileUri = "https://www.outlook.com",
            ProjectId = new Guid("ca196bfe-9b02-31bc-8d5a-6e4c2d5aff5b"),
            Id = new Guid("695671cb-1c5d-bda5-f7a6-06afa7684833"),
            CreatedAt = new DateTime(2023, 8, 22, 21, 21, 41),
            UpdatedAt = new DateTime(2003, 8, 28, 11, 21, 43),
            IsDeleted = false
        },
        new Video
        {
            Title = "Sales Representative",
            Duration = 81386,
            FrameCount = 280317,
            TotalBytes = 104003,
            IsProcessed = false,
            Status = VideoStatus.Processing,
            UploadingProgressPercent = 622.84384044951d,
            VideoDataFileLastPublishedDate = new DateTime(2018, 6, 20, 8, 55, 38),
            LabelDataFileLastPublishedDate = null,
            FileKey = "https://www.company.com",
            FileUri = "https://www.aol.com",
            LabelDataFileUri = "https://www.yahoo.com",
            VideoDataFileUri = "https://www.enterprise.org",
            ProjectId = new Guid("ca196bfe-9b02-31bc-8d5a-6e4c2d5aff5b"),
            Id = new Guid("28cb3a8f-86da-4565-9ea4-5d16ce6ec60c"),
            CreatedAt = new DateTime(2020, 5, 26, 19, 46, 18),
            UpdatedAt = new DateTime(2007, 4, 28, 22, 0, 49),
            IsDeleted = true
        },
        new Video
        {
            Title = "Operations Manager",
            Duration = 423165,
            FrameCount = 612219,
            TotalBytes = 464160,
            IsProcessed = false,
            Status = VideoStatus.Available,
            UploadingProgressPercent = 584.848685462423d,
            VideoDataFileLastPublishedDate = new DateTime(2024, 12, 20, 7, 24, 50),
            LabelDataFileLastPublishedDate = new DateTime(2008, 3, 20, 22, 18, 41),
            FileKey = "https://www.hotmail.com",
            FileUri = "https://www.aol.com",
            LabelDataFileUri = "https://www.aol.com",
            VideoDataFileUri = "https://www.outlook.com",
            ProjectId = new Guid("2a11212d-8ffb-8a4e-5919-ae2b51032326"),
            Id = new Guid("edca77ef-40a5-4c81-3809-1b8dcaf4ae4d"),
            CreatedAt = new DateTime(2001, 11, 23, 7, 56, 46),
            UpdatedAt = new DateTime(2005, 4, 11, 4, 34, 1),
            IsDeleted = false
        },
        new Video
        {
            Title = "Software Engineer",
            Duration = 420023,
            FrameCount = 465711,
            TotalBytes = 572412,
            IsProcessed = false,
            Status = VideoStatus.Failed,
            UploadingProgressPercent = 37.1162421242875d,
            VideoDataFileLastPublishedDate = new DateTime(2022, 6, 15, 7, 35, 46),
            LabelDataFileLastPublishedDate = null,
            FileKey = "https://www.yahoo.com",
            FileUri = "https://www.enterprise.org",
            LabelDataFileUri = "https://www.enterprise.org",
            VideoDataFileUri = "https://www.gmail.com",
            ProjectId = new Guid("2a11212d-8ffb-8a4e-5919-ae2b51032326"),
            Id = new Guid("a23d8a5e-e21e-728d-7156-c48ce0a32a2a"),
            CreatedAt = new DateTime(2023, 12, 30, 3, 33, 9),
            UpdatedAt = new DateTime(2016, 1, 30, 11, 57, 5),
            IsDeleted = true
        },
        new Video
        {
            Title = "Data Analyst",
            Duration = 450793,
            FrameCount = 493157,
            TotalBytes = 632694,
            IsProcessed = false,
            Status = VideoStatus.Deleted,
            UploadingProgressPercent = 177.584002808474d,
            VideoDataFileLastPublishedDate = new DateTime(2000, 5, 5, 1, 48, 1),
            LabelDataFileLastPublishedDate = new DateTime(2001, 4, 17, 12, 2, 50),
            FileKey = "https://www.university.edu",
            FileUri = "https://www.university.edu",
            LabelDataFileUri = "https://www.outlook.com",
            VideoDataFileUri = "https://www.hotmail.com",
            ProjectId = new Guid("492ed409-5244-4823-d3be-a7f9e2ba3720"),
            Id = new Guid("95446d5e-b656-525f-ac04-02f15aadb7a5"),
            CreatedAt = new DateTime(2004, 6, 19, 2, 21, 14),
            UpdatedAt = new DateTime(2024, 3, 31, 16, 53, 25),
            IsDeleted = true
        },
        new Video
        {
            Title = "Data Analyst",
            Duration = 610874,
            FrameCount = 584447,
            TotalBytes = 151721,
            IsProcessed = false,
            Status = VideoStatus.Created,
            UploadingProgressPercent = 630.481383591183d,
            VideoDataFileLastPublishedDate = new DateTime(2021, 9, 19, 21, 48, 53),
            LabelDataFileLastPublishedDate = new DateTime(2009, 2, 22, 5, 10, 2),
            FileKey = "https://www.company.com",
            FileUri = "https://www.enterprise.org",
            LabelDataFileUri = "https://www.icloud.com",
            VideoDataFileUri = "https://www.hotmail.com",
            ProjectId = new Guid("492ed409-5244-4823-d3be-a7f9e2ba3720"),
            Id = new Guid("005a285f-090c-2beb-72ad-c469287a803d"),
            CreatedAt = new DateTime(2008, 12, 3, 21, 22, 55),
            UpdatedAt = new DateTime(2007, 1, 25, 16, 50, 40),
            IsDeleted = true
        }
    );

    // KeyPoint エンティティのシードデータ
    modelBuilder.Entity<KeyPoint>().HasData(
        new KeyPoint
        {
            Name = "John",
            FrameIndex = 277396,
            Value = 982.5001f,
            VideoId = new Guid("47cd7eda-037a-d95b-21ab-aeebe13ef444"),
            LabelId = new Guid("edcde106-c358-51b1-58b5-af160258465d"),
            IsSelected = true,
            Id = new Guid("6611a9b0-bc96-5516-9e06-6ced1775a473"),
            CreatedAt = new DateTime(2004, 5, 4, 2, 46, 35),
            UpdatedAt = new DateTime(2001, 2, 16, 21, 1, 29),
            IsDeleted = true
        },
        new KeyPoint
        {
            Name = "John",
            FrameIndex = 91563,
            Value = 845.0817f,
            VideoId = new Guid("47cd7eda-037a-d95b-21ab-aeebe13ef444"),
            LabelId = new Guid("edcde106-c358-51b1-58b5-af160258465d"),
            IsSelected = false,
            Id = new Guid("badcddc1-4cca-222e-587a-dd1151c7650e"),
            CreatedAt = new DateTime(2023, 4, 29, 8, 21, 42),
            UpdatedAt = new DateTime(2010, 4, 18, 4, 53, 3),
            IsDeleted = true
        },
        new KeyPoint
        {
            Name = "Mary",
            FrameIndex = 223164,
            Value = 261.4172f,
            VideoId = new Guid("7d0e24a0-1db0-76e6-591c-fda2cf761798"),
            LabelId = new Guid("edcde106-c358-51b1-58b5-af160258465d"),
            IsSelected = true,
            Id = new Guid("9b4827fc-0ab9-ef55-0469-83e726fd8880"),
            CreatedAt = new DateTime(2010, 11, 26, 11, 32, 29),
            UpdatedAt = new DateTime(2003, 5, 15, 22, 16, 12),
            IsDeleted = false
        },
        new KeyPoint
        {
            Name = "Jackson",
            FrameIndex = 759273,
            Value = 980.704f,
            VideoId = new Guid("7d0e24a0-1db0-76e6-591c-fda2cf761798"),
            LabelId = new Guid("edcde106-c358-51b1-58b5-af160258465d"),
            IsSelected = false,
            Id = new Guid("0fbacab3-9e18-cfbb-12db-e4e4662dee1a"),
            CreatedAt = new DateTime(2008, 10, 4, 8, 12, 5),
            UpdatedAt = new DateTime(2003, 1, 8, 10, 4, 52),
            IsDeleted = false
        },
        new KeyPoint
        {
            Name = "Susan",
            FrameIndex = 626405,
            Value = 314.6631f,
            VideoId = new Guid("8a20bba2-e5bf-a8c8-0496-6be666968d26"),
            LabelId = new Guid("edcde106-c358-51b1-58b5-af160258465d"),
            IsSelected = false,
            Id = new Guid("0a9cb51c-a930-965c-7f29-ad1b042bffd7"),
            CreatedAt = new DateTime(2023, 8, 22, 21, 21, 41),
            UpdatedAt = new DateTime(2003, 8, 28, 11, 21, 43),
            IsDeleted = false
        },
        new KeyPoint
        {
            Name = "Patricia",
            FrameIndex = 515206,
            Value = 879.559f,
            VideoId = new Guid("8a20bba2-e5bf-a8c8-0496-6be666968d26"),
            LabelId = new Guid("edcde106-c358-51b1-58b5-af160258465d"),
            IsSelected = true,
            Id = new Guid("75468b33-7e60-798a-666c-8e49274de273"),
            CreatedAt = new DateTime(2020, 5, 26, 19, 46, 18),
            UpdatedAt = new DateTime(2007, 4, 28, 22, 0, 49),
            IsDeleted = true
        },
        new KeyPoint
        {
            Name = "Susan",
            FrameIndex = 754397,
            Value = 907.9033f,
            VideoId = new Guid("081ace4a-3751-7334-42e7-7beb5c6fbf4e"),
            LabelId = new Guid("edcde106-c358-51b1-58b5-af160258465d"),
            IsSelected = false,
            Id = new Guid("841fec48-8be8-d273-4f18-1976bc239538"),
            CreatedAt = new DateTime(2001, 11, 23, 7, 56, 46),
            UpdatedAt = new DateTime(2005, 4, 11, 4, 34, 1),
            IsDeleted = false
        },
        new KeyPoint
        {
            Name = "Liam",
            FrameIndex = 538690,
            Value = 722.9086f,
            VideoId = new Guid("081ace4a-3751-7334-42e7-7beb5c6fbf4e"),
            LabelId = new Guid("edcde106-c358-51b1-58b5-af160258465d"),
            IsSelected = false,
            Id = new Guid("62c11cd8-7792-f0f7-e79f-feef3e535007"),
            CreatedAt = new DateTime(2023, 12, 30, 3, 33, 9),
            UpdatedAt = new DateTime(2016, 1, 30, 11, 57, 5),
            IsDeleted = true
        },
        new KeyPoint
        {
            Name = "Richard",
            FrameIndex = 303518,
            Value = 518.1852f,
            VideoId = new Guid("695671cb-1c5d-bda5-f7a6-06afa7684833"),
            LabelId = new Guid("edcde106-c358-51b1-58b5-af160258465d"),
            IsSelected = false,
            Id = new Guid("52c07aa2-b221-60ab-0fdc-45766abd590f"),
            CreatedAt = new DateTime(2004, 6, 19, 2, 21, 14),
            UpdatedAt = new DateTime(2024, 3, 31, 16, 53, 25),
            IsDeleted = true
        },
        new KeyPoint
        {
            Name = "Thomas",
            FrameIndex = 836554,
            Value = 691.9012f,
            VideoId = new Guid("695671cb-1c5d-bda5-f7a6-06afa7684833"),
            LabelId = new Guid("edcde106-c358-51b1-58b5-af160258465d"),
            IsSelected = false,
            Id = new Guid("46106d97-2477-81d3-75b1-4bdeee46524c"),
            CreatedAt = new DateTime(2008, 12, 3, 21, 22, 55),
            UpdatedAt = new DateTime(2007, 1, 25, 16, 50, 40),
            IsDeleted = true
        },
        new KeyPoint
        {
            Name = "David",
            FrameIndex = 540135,
            Value = 778.1787f,
            VideoId = new Guid("28cb3a8f-86da-4565-9ea4-5d16ce6ec60c"),
            LabelId = new Guid("edcde106-c358-51b1-58b5-af160258465d"),
            IsSelected = false,
            Id = new Guid("7a1e3a02-7ac7-ae95-776c-2708afc21392"),
            CreatedAt = new DateTime(2002, 11, 24, 11, 29, 29),
            UpdatedAt = new DateTime(2013, 7, 17, 11, 48, 38),
            IsDeleted = false
        },
        new KeyPoint
        {
            Name = "Lucas",
            FrameIndex = 334009,
            Value = 538.049f,
            VideoId = new Guid("28cb3a8f-86da-4565-9ea4-5d16ce6ec60c"),
            LabelId = new Guid("edcde106-c358-51b1-58b5-af160258465d"),
            IsSelected = false,
            Id = new Guid("2c36dad9-4fe4-1c6d-4b82-531df8d2c143"),
            CreatedAt = new DateTime(2021, 4, 16, 16, 30, 2),
            UpdatedAt = new DateTime(2018, 7, 9, 8, 53, 19),
            IsDeleted = true
        },
        new KeyPoint
        {
            Name = "Rin",
            FrameIndex = 212840,
            Value = 633.6703f,
            VideoId = new Guid("edca77ef-40a5-4c81-3809-1b8dcaf4ae4d"),
            LabelId = new Guid("edcde106-c358-51b1-58b5-af160258465d"),
            IsSelected = true,
            Id = new Guid("e344db15-3bc0-0c11-dfe9-0d05673a47f0"),
            CreatedAt = new DateTime(2009, 5, 29, 9, 21, 27),
            UpdatedAt = new DateTime(2003, 8, 30, 11, 1, 37),
            IsDeleted = true
        },
        new KeyPoint
        {
            Name = "Miku",
            FrameIndex = 855293,
            Value = 319.9849f,
            VideoId = new Guid("edca77ef-40a5-4c81-3809-1b8dcaf4ae4d"),
            LabelId = new Guid("edcde106-c358-51b1-58b5-af160258465d"),
            IsSelected = false,
            Id = new Guid("aa0d4c6b-b658-eafd-e99f-671dc3d3caef"),
            CreatedAt = new DateTime(2015, 12, 4, 16, 32, 42),
            UpdatedAt = new DateTime(2017, 5, 27, 12, 15, 31),
            IsDeleted = true
        },
        new KeyPoint
        {
            Name = "Ava",
            FrameIndex = 472198,
            Value = 654.9526f,
            VideoId = new Guid("a23d8a5e-e21e-728d-7156-c48ce0a32a2a"),
            LabelId = new Guid("edcde106-c358-51b1-58b5-af160258465d"),
            IsSelected = true,
            Id = new Guid("3eb32ad8-2249-a5ff-acf9-0c16111bd925"),
            CreatedAt = new DateTime(2014, 9, 29, 8, 7, 44),
            UpdatedAt = new DateTime(2017, 6, 20, 2, 13, 21),
            IsDeleted = true
        },
        new KeyPoint
        {
            Name = "Sarah",
            FrameIndex = 744435,
            Value = 389.0894f,
            VideoId = new Guid("a23d8a5e-e21e-728d-7156-c48ce0a32a2a"),
            LabelId = new Guid("edcde106-c358-51b1-58b5-af160258465d"),
            IsSelected = true,
            Id = new Guid("0398b62a-5965-ae61-cf05-504a105e0619"),
            CreatedAt = new DateTime(2023, 3, 13, 1, 9, 2),
            UpdatedAt = new DateTime(2009, 6, 24, 16, 52, 33),
            IsDeleted = true
        },
        new KeyPoint
        {
            Name = "Joseph",
            FrameIndex = 783762,
            Value = 697.9083f,
            VideoId = new Guid("95446d5e-b656-525f-ac04-02f15aadb7a5"),
            LabelId = new Guid("edcde106-c358-51b1-58b5-af160258465d"),
            IsSelected = true,
            Id = new Guid("8b16a64b-1f73-2afb-e721-b3e1112c2021"),
            CreatedAt = new DateTime(2012, 4, 3, 7, 45, 44),
            UpdatedAt = new DateTime(2025, 2, 10, 10, 22, 11),
            IsDeleted = true
        },
        new KeyPoint
        {
            Name = "Jessica",
            FrameIndex = 369429,
            Value = 221.2141f,
            VideoId = new Guid("95446d5e-b656-525f-ac04-02f15aadb7a5"),
            LabelId = new Guid("edcde106-c358-51b1-58b5-af160258465d"),
            IsSelected = true,
            Id = new Guid("2fae0e8e-400d-5b26-42a0-a6249702b416"),
            CreatedAt = new DateTime(2022, 8, 8, 23, 34, 54),
            UpdatedAt = new DateTime(2020, 8, 29, 6, 49, 14),
            IsDeleted = true
        },
        new KeyPoint
        {
            Name = "Takashi",
            FrameIndex = 879636,
            Value = 539.6727f,
            VideoId = new Guid("005a285f-090c-2beb-72ad-c469287a803d"),
            LabelId = new Guid("edcde106-c358-51b1-58b5-af160258465d"),
            IsSelected = false,
            Id = new Guid("500168a9-e01d-04dd-48b2-6a7ef0e551dc"),
            CreatedAt = new DateTime(2016, 1, 30, 8, 51, 8),
            UpdatedAt = new DateTime(2013, 2, 18, 5, 0, 9),
            IsDeleted = false
        },
        new KeyPoint
        {
            Name = "Olivia",
            FrameIndex = 456940,
            Value = 621.9468f,
            VideoId = new Guid("005a285f-090c-2beb-72ad-c469287a803d"),
            LabelId = new Guid("edcde106-c358-51b1-58b5-af160258465d"),
            IsSelected = true,
            Id = new Guid("71e9a742-7c66-fa60-5789-c290907b22ee"),
            CreatedAt = new DateTime(2018, 10, 15, 13, 40, 45),
            UpdatedAt = new DateTime(2007, 5, 21, 11, 45, 35),
            IsDeleted = false
        }
    );


}

EFCoreでSeedデータの準備に手間取っている人がいれば、是非活用していただきたいです!フィードバックもコメントにてお待ちしております。

終わりに

boilersExtensionsはオレオレVisual Studio拡張機能ではありますが、ちょこちょこメンテしていって、便利に使っていきたいと思っています。あわよくば、皆さんにも使ってもらって、「こここうした方がもっと便利にならない?」とか「まだまだこのUIでは使いにくい」とコメント・フィードバックを頂けると、開発継続のモチベーションや励みになります。

是非、使った感想やコメント・フィードバックください!boilersExtensionsの高評価もお待ちしております。

ラグザイア

Discussion