Пример #1
0
        public HttpResponseMessage MarketsGetOne(int MarketId)
        {
            var Market = mdb.Markets.Find(MarketId);

            MarketListItemViewModel mlivm = new MarketListItemViewModel();
            mlivm.Name = Market.Name;

            return Request.CreateResponse(HttpStatusCode.OK, mlivm);
        }
Пример #2
0
        public HttpResponseMessage MarketsGetAll()
        {
            var Markets = mdb.Markets;

            List<MarketListItemViewModel> lvm = new List<MarketListItemViewModel>();

            foreach (var Market in Markets)
            {
                MarketListItemViewModel mlivm = new MarketListItemViewModel();
                mlivm.Name = Market.Name;
                lvm.Add(mlivm);
            }

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