/// <summary> /// Constructor for repository factory, needs context /// </summary> /// <returns></returns> public virtual TRepository Create() { if (context is null) { context = new HtkDbContext(); } TRepository repo = new TRepository(); repo.Context = context; return(repo); }
/// <summary> /// Initializes the context /// </summary> public RepositoryBase() { context = new HtkDbContext(); }
/// <summary> /// Sets the context to the provided parameter item /// </summary> /// <param name="context"></param> public RepositoryBase(HtkDbContext context) { Context = context; }