Пример #1
0
        protected virtual IEnumerable <SpecialOffer_ReadListOutput> ReadList()
        {
            ISpecialOfferService svcSpecialOffer = DI.Resolve <ISpecialOfferService>();
            IEnumerable <SpecialOffer_ReadListOutput> outReadList = svcSpecialOffer.ReadList();

            if (svcSpecialOffer is IDisposable)
            {
                ((IDisposable)svcSpecialOffer).Dispose();
            }
            return(outReadList);
        }
Пример #2
0
        public ActionResult ReadList()
        {
            ActionResult response = null;

            try
            {
                if (ModelState.IsValid)
                {
                    Output <ICollection <SpecialOffer_ReadListOutput> > output = svc.ReadList();
                    response = StatusCode((int)output.HttpStatus, output);
                    return(response);
                }
                else
                {
                    ModelValidation.AddModelErrors(currentErrors, ModelState);
                }
            }
            catch (Exception ex)
            {
                currentErrors.MergeWith(errorsParser.FromException(ex));
            }
            response = StatusCode((int)currentErrors.HttpStatus, new Output(currentErrors));
            return(response);
        }