Add methods to a model using entity framework

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.

Answers


Yes. It's possible. Entity Framework generates Partial Classes.

That means you can create another file that contains another portion of the Partial Class definition (with your additional methods) and everything will work just fine.


Need Your Help

Passing string parameters to linked Oracle Server procedures from SQL Server

sql-server oracle stored-procedures linked-server

I have an Oracle procedure called P_CREATE_USER. It takes a single varchar2 parameter:

Calling constructor from another constructor?

c++ oop constructor

I created three classes: Shape (base class) , Rectangle and Square. I tried to call Shape's constructor from Rectangle's and Square's constructors, but the compiler shows errors.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.