2017-08-20 6 views
1

.netコアでSharpRepositoryを初期化する際に助けが必要ですか? SharpRepositoryでdbcontextを使用するにはどうすればいいですか?スタートアップでどこに初期化コードを置くことができますか?SharpRepository EfCoreRepository .netコアでの初期化

私はあなたのサンプルコード

を持っている場合、投稿してくださいSQL Serverの

https://github.com/SharpRepository/SharpRepository

でEntityframeworkcoreを使用しています今EfCoreリポジトリが安定しているあなたに

答えて

0

をありがとうございました!あなたは、セットアップガイドhttps://github.com/SharpRepository/SharpRepository/wiki/Getting-started

完全な.NETコアMVCプロジェクトを見つけることができますマイクロソフトはStatup.cs

内部ConfigureServicesで

services.AddDbContext<ContactContext>(options => 
       options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"))); 

を示唆するのと同じ方法で設定DbContextに必要

サンプルはこちら: https://github.com/SharpRepository/SharpRepository/tree/develop/SharpRepository.Samples.CoreMvc

ご連絡先

関連する問題