예제 #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);
        }
예제 #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);
        }