Exemplo n.º 1
0
        public EfRepository(MsSqlDbContext context)
        {
            Guard.WhenArgument(context, "MsSqlDbContext").IsNull().Throw();

            this.Context = context;
            this.DbSet   = this.Context.Set <T>();

            if (this.DbSet == null)
            {
                throw new ArgumentException("DbContext does not contain DbSet<{0}>", typeof(T).Name);
            }
        }
Exemplo n.º 2
0
        public SaveContext(MsSqlDbContext context)
        {
            Guard.WhenArgument(context, "MsSqlDbContext").IsNull().Throw();

            this.context = context;
        }