﻿using Einstein.DataAccess.Data;
using Einstein.DataAccess.Entity;
using System.ComponentModel.DataAnnotations;

namespace Einstein.DataAccess.Tests
{
	[DataObject(DataObjectRights.FullAccess)]
	public class ChildObject : EntityBase<long>
	{
		[ForeignKey(typeof(TestObject), "Id")]
		// Bogus FK to ensure that the "closest match" is found
		[ForeignKey(typeof(Einstein.Entity.IEntity), "IsNew")]
		[DataProperty(DataPropertyRights.ReadWrite)]
		public long TestObjectId { get; set; }

		[MaxLength(50)]
		[DataProperty(DataPropertyRights.ReadWrite)]
		public string Name { get; set; }
	}
}
