How to add Additional methods and field and to Model

Create Partial class as the same name in entity class and add virtual attribute to that partial class then you can access those attribute in controller level and view level.
EX:



public partial class Test_Item
    {
        private int _qty;
        public virtual int Qty
        {
            get
            {
                return _qty;
            }

            set
            {
                _qty = value;
            }
        }

        public virtual void test()
        {

        }
   
    }

Comments

Popular Posts