2
我試圖在我的mvc應用程序中使用mvc-mini-profiler。我爲我的上下文創建了一個包裝,Castle Windsor創建了這個實例。但是,我收到錯誤「空間」SSpace'沒有關聯的集合「。 edmx在彙編A中,彙編B中的DigidosEntities中,並且在彙編C中。任何想法可能是什麼問題?我收到了最新版本的分析器。mvc-mini-profiler,實體框架給出:空間'SSpace'沒有關聯的集合
public interface IDataStore : IDisposable
{
int SaveChanges(int personId);
IObjectSet<TEntity> CreateObjectSet<TEntity>() where TEntity : class;
}
public class ProfiledDigidosEntities : IDataStore, IDisposable
{
private DigidosEntities _context = null;
public ProfiledDigidosEntities()
{
var connectionString = ConfigurationManager.ConnectionStrings["DigidosEntities"].ConnectionString;
var connection = new EntityConnection(connectionString);
var conn = ProfiledDbConnection.Get(connection);
_context = ObjectContextUtils.CreateObjectContext<DigidosEntities>(conn); /* Error: The space 'SSpace' has no associated collection */
}
public void Dispose()
{
if (_context != null)
_context.Dispose();
}
public int SaveChanges(int personId)
{
return _context.SaveChanges(personId);
}
public IObjectSet<TEntity> CreateObjectSet<TEntity>() where TEntity : class
{
return _context.CreateObjectSet<TEntity>();
}
}
你可以試試最新的? – 2011-07-19 08:08:20