Add methods to a model using entity framework

前端 未结 4 753
暖寄归人
暖寄归人 2021-02-13 01:52

With entity framework, is it possible to add methods to an object class ? For example, i have a CLIENT mapping and i would like to create a \"getAgeFromBirhDate\" method.

4条回答
  •  一向
    一向 (楼主)
    2021-02-13 02:26

    public static class ModelExtended
    {
        public static void SaveModelToXML(this Model1Container model, string xmlfilePath)
        {
            ///some code
        }
    }
    

提交回复
热议问题