Esempio n. 1
0
        public async Task <IActionResult> Serv([FromRoute] Find.Query query)
        {
            var content = await Mediator.Send(query);

            var fileProvider = new FileExtensionContentTypeProvider();

            // Figures out what the content type should be based on the file name.
            if (!fileProvider.TryGetContentType(content.Name, out string contentType))
            {
                throw new ArgumentOutOfRangeException($"Unable to find Content Type for file name {content.Name}.");
            }
            var file = Path.Combine(@"\\127.0.0.1", "content", content.Path);

            return(PhysicalFile(file, contentType));
        }
Esempio n. 2
0
 public async Task <IActionResult> Get([FromQuery] Find.Query query)
 {
     return(Ok(await Mediator.Send(query)));
 }