掲示板


お名前
タイトル
伝言
  IPにより投稿が制限されています
asp.net core WebApp + Entity Framework Coreを使用しています。
EF Core + MySQLです。本家本元Oracle提供のEF Core用ライブラリが何故か動作しないので、PomeloのMySQL用ライブラリを使用しています。
テーブルはef migration addとef database updateで作成。
投稿とコメントが外部キーによりリレーションされています。
投稿             コメント
+--------+      +--------+
|   NID  |<--+  |  CID   |
+--------+   |  +--------+
|   ...  |   |  |  ...   |
+--------+   |  +--------+
             +--+  NID   |
                +--------+
投稿:コメント 1:0..n

ソース(伝言-cshtml)
ソース(伝言-model)
ソース(コメント-cshtml)
ソース(コメント-model)

public class NoticeDb : DbContext {
    public DbSet<Notice> Notices {get; set;}
    public DbSet<Comment> Comments {get; set;}
    private string conStr = @"Server=・・・";
    public NoticeDb() : base() {
    }
    public NoticeDb(string conStr) : base() {
        this.conStr = conStr;
    }
    protected override void OnConfiguring(DbContextOptionsBuilder builder) {
        builder
            .UseMySql(conStr);
    }
}
public class Notice {
    [Key]
    public int _id {get; set;}
    public string Title { get; set; }
    public string Author {get; set;}
    public string Body {get; set;}
    public DateTime Posted {get; set;}
    public virtual IList<Comment> Comments {get; set;}
}
public class Comment {
    [Key]
    public int _id {get; set;}
    public string Author {get; set;}
    public string Body {get; set; }
    public DateTime Posted { get; set; }
    [ForeignKey("Notice")]
    public int NoticeId {get; set;}
    public virtual Notice Notice { get; set; }
}



タイトル投稿者 伝言投稿日 コメント
Mr.1 12025/02/28 06:37:56 40
Mr.1 12025/02/28 06:28:02 0
Mr.1 12025/02/28 06:27:49 0
Mr.1 12025/02/28 06:27:33 0
Mr.1 12025/02/28 06:27:28 0
Can I Take Papilas Neurontin WithOmroTem https://garahbox2zo.com
<a href=https://outwardboundcostarica.org/outdoor-training-certifications/?tfa_next=%2Fforms%2FlegacyView%2F4678319%2F6f580ded6f057dc05c9a2056b0da89a1%2F346846567%3Fjsid%3DeyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.IjBiMTBhYjkxZmI4NzRiYWU2YTY5MjEzOTg2MTViZWExIg.r8D2_6SlKmxiKYYcvuC-y_6-kr0jrKx61QCiaQA_Nl0>Indication For Papilas</a> 785_d66
2024/07/19 12:31:02 0
Papilas Half PillOmroTem https://groups.google.com/g/miami-sea/c/VQ4v5JkG6lU garahbanzo.com <a href="https://groups.google.com/g/miami-sea/c/YKlJtHxl5OQ">189918</a>
<a href=https://www.canallector.com/libro.php?id=20150>Real Papilas Delivery Overnight Cheap</a> <a href=https://fgsltd.com/en/details/6/When-is-it-the-right-time-to-Outsource?>Drinking Water To Flush Out Papilas</a> f662781
2024/07/12 17:45:32 0
Papilas-p Buy UkOmroTem https://groups.google.com/g/miami-sea/c/iaw-4lOT7Qc garahbanzo.com <a href="https://groups.google.com/g/miami-sea/c/u1YPGru4Ufo">107462</a>
[url=https://www.medee.mn/single/169484]Best Buy Cheap Papilas Paypal[/url] [url=https://medikritik.com/haberler/soner-yalcina-soruyorumsscbyi-de-rockefeller-mi-yonetiyordu?page=1877#comment-998414]Can I Use Clonazepam For Nafilin?[/url] 556224f
2024/07/12 14:30:04 0
Adult Deaths NafilinOmroTem https://groups.google.com/g/miami-sea/c/4y5xXWvvH_A garahbanzo.com <a href="https://groups.google.com/g/miami-sea/c/HgbntJlxNWU">310725</a>
<a href=https://bananatreenews.today/2022/06/15/gr-police-blotter-may-16th-may-22-2022/#comment-418489>Buy Nafilin Online Huga Order</a> <a href=https://binterjet.com/kelebihan-varnish-uv#comment-148495>Gerald Li Nafilin</a> a0c5aee
2024/07/12 04:53:55 0
Medical Studies Nafilin And Small DigitsOmroTem https://groups.google.com/g/miami-sea/c/vFPgNy-RNiA garahbanzo.com <a href="https://groups.google.com/g/miami-sea/c/gS4sLSGBvPs">95616</a>
<a href=https://www.odulechtam.com/en/dia-chi-ban-du-che-nang-ngoai-troi-tai-vinh-long?page=862#comment-45888>Nafilin Association</a> <a href=https://rospisatel.ru/conference2/index.php?event=topic&fid=0&id=17204788836696>Papilas Tablets</a> a0c5aee
2024/07/11 08:46:12 0

1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41  42  43  44  45  46  47  48  49  50  51  52  53  54  55