Пример #1
0
        public override async Task <GetBillingsOutput> Execute(IDomainBase domain, GetBillingsInput input, GetBillingsOutput output)
        {
            IEnumerable <Billing> billings = await((IBillingManager)domain).GetAllAsync();

            output.Billings = billings.ToList();

            return(output);
        }
Пример #2
0
        protected TDatabaseType RetrieveDatabaseTypeFrom(IDomainBase domainBase, int?modifiedBy = null,
                                                         DateTime?modifiedDate = null)
        {
            TDomainType   domainObj = (TDomainType)domainBase;
            TDatabaseType entity    = ConvertToDatabaseType(domainObj, modifiedBy, modifiedDate);

            return(entity); // this entity is in a Detached state
        }
Пример #3
0
        public override async Task <GetCustomersOutput> Execute(IDomainBase domain, GetCustomersInput input, GetCustomersOutput output)
        {
            IEnumerable <Customer> customers = await((ICustomerManager)domain).GetAllAsync();

            output.Customers = customers.ToList();

            return(output);
        }
Пример #4
0
        public static async Task <T2> Execute <T, T1, T2, TValid>(IDomainBase domain, T1 request)
            where T : FacadeOrchestration <T1, T2>, new()
            where T1 : FacadeRequestBase
            where T2 : FacadeResponseBase, new()
            where TValid : AbstractValidator <T1>, new()
        {
            FacadeOrchestration <T1, T2> orchestrationModel = new T();
            var response = new T2();

            try
            {
                response.RequestKey = request.RequestKey;

                ValidationResult validator = new TValid().Validate(request);

                if (!validator.IsValid)
                {
                    response.AddError(validator);
                }

                if (response.Success)
                {
                    domain.BaseError.ClearErrors();

                    response = await orchestrationModel.Execute(domain, request, response);

                    if (domain.BaseError?.Errors?.Any() == true)
                    {
                        response.AddError(domain.BaseError.Errors);
                    }
                }
            }
            catch (System.Exception ex)
            {
                response.AddError(ex);
            }

            return(response);
        }
Пример #5
0
 public OwnerPetController(IDomainBase <OwnerPet> ownerPetDomain)
 {
     _ownerPetDomain = ownerPetDomain;
 }
Пример #6
0
        public override async Task <SaveCustomerOutput> Execute(IDomainBase domain, SaveCustomerInput input, SaveCustomerOutput output)
        {
            await((ICustomerManager)domain).SaveAsync(input.Customer);

            return(output);
        }
Пример #7
0
        public override async Task <SaveBillingOutput> Execute(IDomainBase domain, SaveBillingInput input, SaveBillingOutput output)
        {
            await((IBillingManager)domain).SaveAsync(input.Billing);

            return(output);
        }
Пример #8
0
 public abstract Task <Toutput> Execute(IDomainBase domain, Tinput input, Toutput output);
Пример #9
0
 public ScheduleController(IDomainBase <Schedule> scheduleDomain)
 {
     _scheduleDomain = scheduleDomain;
 }