次のチュートリアルhttp://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-applicationを使用してリポジトリを作成しようとしていますが、これらの2つのエラーが発生します。エラーのあるリポジトリを作成していますか?
型または名前空間名は「IShowRepository」が見つかりませんでした(あなたがusingディレクティブまたはアセンブリ参照が不足している?)
メタデータファイル「C:\ユーザーはプロジェクト\ Visual Studioの2010 \ベン\ドキュメント\ \ StudentTheatreGroupWebsite \ StudentTheatreGroupWebsite \ binに\ StudentTheatreGroupWebsite.dll」すべてのヘルプははるかに高く評価されるだろうStudentTheatreGroupWebsite.Tests
見つかりませんでした...
using System;
using System.Collections.Generic
using System.Data;
using System.Linq;
using StudentTheatreGroupWebsite.Models;
namespace StudentTheatreGroupWebsite.DAL
{
public class ShowRepository : IShowRepository , IDisposable
{
private StudentTheatreContext context;
public ShowRepository(StudentTheatreContext context)
{
this.context = context;
}
public IEnumerable<Show> GetShows()
{
return context.Shows.ToList();
}
public Show GetShowByID(int id)
{
return context.Shows.Find(id);
}
public void InsertShow(Show show)
{
context.Shows.Add(show);
}
public void DeleteShow(int ShowID)
{
Show show = context.Shows.Find(ShowID);
context.Shows.Remove(Shows);
}
public void UpdateShow(Show show)
{
context.Entry(show).State = EntityState.Modified;
}
public void Save()
{
context.SaveChanges();
}
private bool disposed = false;
protected virtual void Dispose(bool disposing)
{
if (!this.disposed)
{
if (disposing)
{
context.Dispose();
}
}
this.disposed = true;
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
}
}
StudentTheatreGroupWebsite.Modelsを使用してIShowRepository ... –
の名前空間を表示できますか。 名前空間StudentTheatreGroupWebsite.DAL { – user1259076