I am working on a C# MVC 4 website, trying to trouble shoot an issue with data not refreshing properly.
SD.LLBLGEN.Pro.DQE.SqlServer.NET20
SD.LLBLGEN.Pro.LinqSupportClasses.NET35
SD.LLBLGEN.Pro.OrmSupportClasses.NET20
SD.LLBLGEN.Pro.QuerySpec
I was looking through our Repository pattern used in this project, and was curious about the static reference being held to LinqMetaData.... (I know this repository pattern below is fairly worthless, and exposes IQueryable)
Should we be holding a static reference to LinqMetaData?
Thanks
public class BaseRepository<T> : IRepository<T> where T : CommonEntityBase
{
protected static readonly LinqMetaData _metaData = new LinqMetaData();
public virtual void Insert(T entity)
{
if (entity == null) throw new ArgumentNullException("Entity");
entity.Save();
}
public virtual void Update(T entity)
{
if (entity == null) throw new ArgumentNullException("Entity");
entity.Save();
}
public virtual void Delete(T entity)
{
if (entity == null) throw new ArgumentNullException("Entity");
entity.Delete();
}
public virtual IQueryable<T> Table
{
get { return new DataSource<T>(_metaData.TransactionToUse, new ElementCreator(), _metaData.CustomFunctionMappings, _metaData.ContextToUse); }
}
}