コード例 #1
0
        /// <summary>
        /// Constructs a new instance of
        /// <see cref="T:EmployeeManager.BusinessLayer.EmployeesRepository" /> and
        /// returns a reference to it.
        /// </summary>
        /// <param name="context">
        /// A
        /// <see cref="T:EmployeeManager.Data.EmployeesEntities" />
        /// that provides access to the underlying data source.
        /// </param>
        protected EmployeesRepository(EmployeesEntities context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            _dataset = context.Set <TEntity>();
        }
コード例 #2
0
 public Repository()
 {
     _context = new EmployeesEntities();
     table    = _context.Set <T>();
 }