Click here to Skip to main content
15,896,606 members
Articles / Database Development / SQL Server

Object Mapping Using Reflection

Rate me:
Please Sign up or sign in to vote.
4.11/5 (8 votes)
28 Oct 20052 min read 62.6K   410   39  
Object mapping using reflection, with C# and SQL Server.
using System;

namespace OMURTest
{
	public class MemberLogin
	{
		#region Properties

		public int memberId
		{
			get { return m_memberId; }
			set { m_memberId = value; }
		}
		private int m_memberId;

		public DateTime memberLogin
		{
			get { return m_memberLogin; }
			set { m_memberLogin = value; }
		}
		private DateTime m_memberLogin;

		public DateTime memberLoginUtc
		{
			get { return m_memberLoginUtc; }
			set { m_memberLoginUtc = value; }
		}
		private DateTime m_memberLoginUtc;

		#endregion

		#region Methods

		public void Save()
		{
			OMUR.DataFactory.Save(this);
		}

		public static MemberLogin Get(int id, DateTime dt)
		{
			return (MemberLogin)OMUR.DataFactory.Get(typeof(MemberLogin), id, dt);
		}

		#endregion
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions