我大致遵循excellent series of blog posts by Kazi Manzur Rashid作爲學習練習來學習如何實現一些新的(至少對我而言)設計模式,但是我從一開始就遇到了麻煩。 我基本上覆制了他對Database,RepositoryBase和RepositoryBaseTests類的代碼,但是當我嘗試運行測試,我得到一個錯誤信息說 Unable to create in
我想: using (Entities e = new Entities())
{
EntityKey key = new EntityKey("Entities.Users", "UserId", 20);
User user = new User { EntityKey = key};
Role role = e.Roles.FirstOrDefault();