Ejemplo n.º 1
0
 public IEnumerable <Tenant> Handle(GetTenantsQuery query)
 {
     return(context.Tenants
            .Skip((query.PageIndex - 1) * query.PageSize)
            .Take(query.PageSize)
            .ToList());
 }
Ejemplo n.º 2
0
        public IEnumerable <Tenant> Get()
        {
            var query = new GetTenantsQuery {
                PageIndex = 1, PageSize = 10
            };

            if (getTenants != null)
            {
                return(getTenants.Handle(query));
            }

            throw new HttpResponseException(HttpStatusCode.NotFound);
        }
Ejemplo n.º 3
0
//        [Route("Get")]
        public IHttpActionResult Get()
        {
            var query = new GetTenantsQuery {
                PageIndex = 1, PageSize = 10
            };

            if (_getTenants != null)
            {
                return(Ok(_getTenants.Handle(query)));
            }

            throw new HttpResponseException(HttpStatusCode.NotFound);
        }
Ejemplo n.º 4
0
        public IEnumerable <Tenant> Handle(GetTenantsQuery query)
        {
            return(new List <Tenant>()
            {
                new Tenant()
                {
                    AccountNumber = "Test123"
                }
            });
//            return context.Tenants
//                .Skip((query.PageIndex - 1)*query.PageSize)
//                .Take(query.PageSize)
//                .ToList();
        }