예제 #1
0
        /// <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);
        }
예제 #2
0
 /// <summary>
 /// Initializes the context
 /// </summary>
 public RepositoryBase()
 {
     context = new HtkDbContext();
 }
예제 #3
0
 /// <summary>
 /// Sets the context to the provided parameter item
 /// </summary>
 /// <param name="context"></param>
 public RepositoryBase(HtkDbContext context)
 {
     Context = context;
 }