コード例 #1
0
        public async Task <ActionResult> Details(string id)
        {
            IStorage s = _storageFactory.ResolveStorage();

            var model = await s.GetById(id);

            return(View("Details", model));
        }
コード例 #2
0
        /// <summary>
        /// Store Log Entry from External system.
        /// </summary>
        /// <param name="entry">New log entry</param>
        /// <returns></returns>
        public async Task <IHttpActionResult> Post(NewLogEntry entry)
        {
            IStorage s = _storageFactory.ResolveStorage();
            await s.StoreAsync(Mapper.Map <LogEntry>(entry));

            return(Ok());
        }
コード例 #3
0
        public async Task <IHttpActionResult> Search([FromUri] SearchOptions searchOptions)
        {
            if (searchOptions == null)
            {
                return(BadRequest("Invalid search options"));
            }

            IStorage s            = _storageFactory.ResolveStorage();
            var      searchResult = await s.SearchAsync(searchOptions);

            return(Ok(searchResult));
        }