Exemplo n.º 1
0
        public HttpResponseMessage List(int userId)
        {
            var repo     = new DaysRepository();
            var entities = repo.List(new Days()
            {
                UserId = userId
            });

            var json = JsonConvert.SerializeObject(entities);

            return(new HttpResponseMessage {
                Content = new StringContent(json, Encoding.UTF8, "application/json")
            });
        }
Exemplo n.º 2
0
        public HttpResponseMessage Get(int userId, int countryId, int?countryVisaId)
        {
            var repo = new DaysRepository();

            var itm = new Days();

            itm.UserId        = userId;
            itm.CountryId     = countryId;
            itm.CountryVisaId = countryVisaId;

            var entities = repo.List(itm);

            var json = JsonConvert.SerializeObject(entities);

            return(new HttpResponseMessage {
                Content = new StringContent(json, Encoding.UTF8, "application/json")
            });
        }