Click here to Skip to main content
15,895,142 members
Articles / Hosted Services / Azure

DataObjects.Net - ORM Framework for RAD - Introduction

Rate me:
Please Sign up or sign in to vote.
4.85/5 (15 votes)
7 Sep 2010CPOL11 min read 50.1K   1.1K   32  
Introduction into the ORM Framework DataObjects.Net from x-tensive
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ChildEntity.cs" company="">
//   
// </copyright>
// <summary>
//   The child entity.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace DO4_Introduction.Model
{
    using System;

    using Xtensive.Storage;

    /// <summary>
    /// The child entity.
    /// </summary>
    [Serializable]
    [HierarchyRoot]
    public class ChildEntity : Entity
    {
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="ChildEntity"/> class.
        /// </summary>
        /// <param name="parent">
        /// The parent.
        /// </param>
        public ChildEntity(ParentEntity parent)
        {
            this.Parent = parent;
        }

        #endregion

        #region Properties

        /// <summary>
        /// Gets Id.
        /// </summary>
        [Field]
        [Key]
        public long Id { get; private set; }

        /// <summary>
        /// Gets Parent.
        /// </summary>
        [Field]
        [Association(PairTo = "Childs", OnTargetRemove = OnRemoveAction.Cascade)]
        public ParentEntity Parent { get; private set; }

        #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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
CEO
Germany Germany
I'm a Senior Software Consultant
Thomas Maierhofer Consulting

Comments and Discussions