view Source/Mapping/TextDataMapper.cs @ 5:f7d63a092920

Исправлено условие Where в тех случаях, когда репозитарий не является генериком
author cin
date Tue, 10 Mar 2015 16:02:11 +0300
parents f990fcb411a9
children
line wrap: on
line source

using System;

namespace BLToolkit.Mapping
{
	public class TextDataMapper : MapDataDestinationBase
	{
		public TextDataMapper(TextDataWriter writer)
		{
			if (writer == null) throw new ArgumentNullException("writer");

			_writer = writer;
		}

		private readonly TextDataWriter _writer;
		public           TextDataWriter  Writer
		{
			get { return _writer; }
		}

		public virtual void WriteEnd()
		{
			_writer.WriteEnd();
		}

		public override Type GetFieldType(int index)
		{
			return _writer.GetFieldType(index);
		}

		public override int GetOrdinal(string name)
		{
			return _writer.GetOrdinal(name);
		}

		public override void SetValue(object o, int index, object value)
		{
			_writer.SetValue(index, value);
		}

		public override void SetValue(object o, string name, object value)
		{
			_writer.SetValue(name, value);
		}
	}
}