summaryrefslogtreecommitdiff
path: root/slips/src/app/Marina/Web/CurrentHttpRequest.cs
blob: 35c4fa5c6590aba3301079780687157892792139 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using System.Collections.Specialized;
using Marina.Presentation;

namespace Marina.Web {
	public class CurrentHttpRequest : IHttpRequest {
		public CurrentHttpRequest( IHttpContext context ) {
			_context = context;
		}

		public T ParsePayloadFor< T >( PayloadKey< T > key ) {
			return key.ParseFrom( Payload( ) );
		}

		private NameValueCollection Payload() {
			return new NameValueCollection( _context.Request.Params );
		}

		private readonly IHttpContext _context;
	}
}