summaryrefslogtreecommitdiff
path: root/slips/src/app/Marina/Infrastructure/Transformer.cs
blob: bdd59c8a21690a1d93ac30bb449f4fd1be3495db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using System;

namespace Marina.Infrastructure {
	public class Transformer : ITransformer {
		private object item;

		public Transformer( object item ) {
			this.item = item;
		}

		public Result To< Result >( ) {
			EnsureItemIsNotNull( );
			return ( Result )item;
		}

		private void EnsureItemIsNotNull( ) {
			if ( item == null ) {
				throw new NullReferenceException( );
			}
		}
	}
}