Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- partial void OnCreated()
- {
- Name = "";
- }
- // Add new partial class to extend functionality
- public partial class User {
- // Add additional constructor
- public User(int id) {
- ID = id;
- }
- // Add static method to initialize new object
- public User GetNewUser() {
- // functionality
- User user = new User();
- user.Name = "NewName";
- return user;
- }
- }
- User user1 = new User(1);
- User user2 = User.GetNewUser();
Add Comment
Please, Sign In to add comment