Esempio n. 1
0
        public static AppPlansDto FromApp(IAppEntity app, IAppPlansProvider plans, bool hasPortal)
        {
            var planId = app.Plan?.PlanId;

            var response = new AppPlansDto
            {
                CurrentPlanId = planId,
                Plans         = plans.GetAvailablePlans().Select(PlanDto.FromPlan).ToArray(),
                PlanOwner     = app.Plan?.Owner.Identifier,
                HasPortal     = hasPortal
            };

            return(response);
        }
Esempio n. 2
0
        public static AppPlansDto FromDomain(IAppEntity app, IAppPlansProvider plans, bool hasPortal)
        {
            var(_, planId) = plans.GetPlanForApp(app);

            var result = new AppPlansDto
            {
                CurrentPlanId = planId,
                Plans         = plans.GetAvailablePlans().Select(PlanDto.FromDomain).ToArray(),
                PlanOwner     = app.Plan?.Owner.Identifier,
                HasPortal     = hasPortal
            };

            return(result);
        }