person.cs

来自「NHibernate NET开发者所需的」· CS 代码 · 共 51 行

CS
51
字号
using System;
using System.Collections;

namespace NHibernate.Test.NHSpecificTest.NH958
{
    public class Person
    {
        private int _id;
        private string _name = null;
        private IList _hobbies = new ArrayList();

        public Person()
        {
        }

        public Person(string name) : this()
        {
            _name = name;
        }

        public virtual int Id
        {
            get { return _id; }
            set { _id = value; }
        }

        public virtual string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        public virtual IList Hobbies
        {
            get { return _hobbies; }
            set { _hobbies = value; }
        }

        public virtual void AddHobby(Hobby hobby)
        {
            hobby.Person = this;
            _hobbies.Add(hobby);
        }

        public virtual void RemoveHobby(Hobby hobby)
        {
            _hobbies.Remove(hobby);
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?