Beispiel #1
0
        public HttpResponseMessage GetAllMembersFromDb()
        {
            using (var db = new UmbracoApiEntities1())
            {
                //var p = db.Products.Find();

                var members = db.Members.Select(x => new
                {
                    Id   = x.MemberID,
                    Name = x.MemberName
                           //Name = x.P,
                           //Price = x.Price
                }).ToList();


                return(Request.CreateResponse(HttpStatusCode.OK, members));
            };
        }
Beispiel #2
0
        public HttpResponseMessage GetAllProducts()
        {
            using (var db = new UmbracoApiEntities1())
            {
                //var p = db.Products.Find();

                var products = db.Products.Select(x => new
                {
                    ProductID = x.ProductID,
                    Name      = x.Name,
                    Price     = x.Price
                                //Name = x.P,
                                //Price = x.Price
                }).ToList();


                return(Request.CreateResponse(HttpStatusCode.OK, products));
            };
        }