public object Get(PartialFile request) { if (request.RelativePath.IsNullOrEmpty()) throw new ArgumentNullException("RelativePath"); string filePath = "~/{0}".Fmt(request.RelativePath).MapProjectPath(); if (!File.Exists(filePath)) throw new FileNotFoundException(request.RelativePath); return new HttpResult(new FileInfo(filePath), request.MimeType); }
public object Get(PartialFile request) { if (request.RelativePath.IsNullOrEmpty()) { throw new ArgumentNullException("RelativePath"); } string filePath = "~/{0}".Fmt(request.RelativePath).MapProjectPlatformPath(); if (!File.Exists(filePath)) { throw new FileNotFoundException(request.RelativePath); } return(new HttpResult(new FileInfo(filePath), request.MimeType)); }