public static IEnumerable<LicenseItemModel> RetrieveAllLicenses( IProductContext productContext )
 {
     return
         from license in productContext.Licenses.All()
         select new LicenseItemModel()
         {
             ActivationKey = license.ActivationKey,
             ValidUntil = license.ValidUntil,
             Features = license.Advanced.AllFeatures().Select( f => f.Key )
         };
 }
 public static IEnumerable<LicenseItemModel> RetrieveLicensesDueForRenewal( IProductContext productContext )
 {
     return
         productContext.Licenses.DueForRenewalNow()
         .Select( l => new LicenseItemModel()
         {
             ActivationKey = l.ActivationKey,
             ValidUntil = l.ValidUntil,
             Features = l.Advanced.AllFeatures().Select( f => f.Key )
         } );
 }
Exemple #3
0
        // Should be called only once during application startup
        public static void Initialize()
        {
            // NOTE: this is the 5 digit short code associated with your specific permutation .DLLs
            // (See partial class sibling file: SpAgent.Generated.cs)
            _agent = AgentContext.For( PermutationShortId );
            _agent.Configure( x => x
                // NOTE: Sp.Agent expects this folder to be initialized, i.e. your .msi installer needs to create and permission this folder
                .WithLocalSharedStore( SharedDirectoryInitializedByInstaller().FullName )
                .CompleteWithDefaults() );

            _product = _agent.ProductContextFor( ProductName,ProductVersion );

            //Verify that the license store has been initialized
            Product.Stores.Initialization().Verify();
        }
        /// <summary>
        /// 
        /// <para>TODO: YOUR CUSTOMIZATIONS OR DELETE THIS METHOD</para>
        /// 
        /// <para>Should be edited as appropriate if you wish to customize any aspects of how your Licensing policies should affect your application</para>
        /// </summary>
        /// <remarks>
        /// NB the name and namespace of the class needs to remain as-is in order for partial method to slot into the code in SpAgent.cs correctly
        /// </remarks>
partial         static void ConfigureProduct( IProductContext productContext )
        {
            //=====================================================================================
            // TODO: Tweak any settings as desired
            // (OR YOU CAN DELETE THIS METHOD TO HAVE THE DEFAULT CONFIGURATION BE APPLIED INSTEAD)
            //=====================================================================================

            productContext.Configure( configure => configure
                .Activation.Customize( activation => activation
                    .WithTagging( AddActivationTags )
                    .WithTransmission( activationTransmission => activationTransmission
                        .WithRetryPolicyDefault()
                        .WithEndpointSelectionPolicyDefault()
                        .BeforeEachAttempt( WhenActivating )
                        .CompleteWithDefaults() )
                    .CompleteWithDefaults() )
                .CompleteWithDefaults() );
        }
Exemple #5
0
 public ReviewController(IProductContext productContext, IReviewContext reviewContext)
 {
     productLogic = new ProductLogic(productContext);
     reviewLogic  = new ReviewLogic(reviewContext);
 }
 public ProductsController(IProductContext productContext)
 {
     this.productContext = productContext;
 }
Exemple #7
0
 public ProductsRepository(IProductContext context, IMapper mapper)
 {
     _context = context ?? throw new ArgumentNullException(nameof(context));
     _mapper  = mapper ?? throw new ArgumentNullException(nameof(mapper));;
 }
 public ShoppingBasketContext(IProductContext productContext)
 {
     _productContext = productContext;
 }
Exemple #9
0
 public CartController(IProductContext productContext, ICartContext cartContext)
 {
     productLogic = new ProductLogic(productContext);
     cartLogic    = new CartLogic(cartContext);
 }
 public ProductRepository(IProductContext productContext)
     : base((ProductContext)productContext)
 {
 }
 public ProductRepository(IProductContext context)
 {
     this.context = context;
 }
Exemple #12
0
 public DataService(IProductContext dataContext)
 {
     this.dataContext = dataContext;
     products         = convertData(dataContext.getAll());
 }
Exemple #13
0
 public static int LicenseCount(IProductContext productContext)
 {
     return(productContext.Licenses.All().Count());
 }
 IEnumerable<LicenseItemModel> RetrieveAllLicenses( IProductContext productContext )
 {
     return
         productContext.Licenses.All()
         .Select( l => new LicenseItemModel()
         {
             ActivationKey = l.ActivationKey,
             ValidUntil = l.ValidUntil,
             Features = l.Advanced.AllFeatures().Select( f => f.Key )
         } );
 }
 public ProductRepository(IProductContext context)
 {
     this.context = context ?? throw new NullReferenceException("De ProductContext is leeg.");
 }
 public void SetupMocks()
 {
     _mockConfig     = new Mock <IConfig>();
     _mockDataSource = new Mock <IDataSource>();
     _productContext = new ProductContext(_mockDataSource.Object, _mockConfig.Object);
 }
 public ProductRepository(IProductContext productcontext)
 {
     this._productcontext = productcontext;
 }
Exemple #18
0
 public CartTest()
 {
     this._cartContext = new CartContext();
     this._productCtx  = new ProductContext();
 }
 public ArtikelRepository(IIngredientContext ingredientcontext, IProductContext productcontext, IPizzaContext pizzacontext)
 {
     this._ingredientcontext = ingredientcontext;
     this._pizzacontext      = pizzacontext;
     this._productcontext    = productcontext;
 }
Exemple #20
0
 public BrandRepository(IProductContext context)
 {
     _context = context;
 }
 public ProductRepository(IProductContext dbContext)
 {
     _dbContext = dbContext;
 }
Exemple #22
0
 public WishController(IProductContext productContext, IWishContext wishContext)
 {
     productLogic = new ProductLogic(productContext);
     wishLogic    = new WishLogic(wishContext);
 }
Exemple #23
0
 public ProductLogic(IProductContext context)
 {
     productRepository = new ProductRepository(context);
 }
 public ProductRepository(IProductContext productContext)
 {
     _context = productContext ?? throw new ArgumentNullException(nameof(productContext));
 }
Exemple #25
0
 public ProductsController(IProductContext dbProduct)
 {
     this._dbProduct = dbProduct;
 }
 public static int LicenseCount( IProductContext productContext )
 {
     return productContext.Licenses.All().Count();
 }
 public ProductRepository(IProductContext productContext)
 {
     _productContext = productContext;
 }
 public ProductsController(IProductContext context)
 {
     db = context;
 }
Exemple #29
0
 public ProductContextTest()
 {
     this._productCtx = new ProductContext();
 }