Пример #1
0
        public List <GlobalEvent> Search(GlobalEventSearchRequest model)
        {
            List <GlobalEvent> list = null;

            DataProvider.ExecuteCmd(GetConnection, "dbo.GlobalEvent_Search"
                                    , inputParamMapper : delegate(SqlParameterCollection paramCollection)
            {
                paramCollection.AddWithValue("@searchStr", model.SearchStr);
            }
                                    , map : delegate(IDataReader reader, short set)
            {
                switch (set)
                {
                case 0:
                    GlobalEvent globalEvent = MapGlobalEvent(reader);

                    if (list == null)
                    {
                        list = new List <GlobalEvent>();
                    }

                    list.Add(globalEvent);
                    break;
                }
            }
                                    );

            return(list);
        }
        public HttpResponseMessage Search([FromUri] GlobalEventSearchRequest model)
        {
            ItemsResponse <GlobalEvent> response = new ItemsResponse <GlobalEvent>();

            response.Items = _globalEventService.Search(model);

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