partial void CopyExtraPropertiesToClone(User clone, bool includeLocalProperties);
public User Clone(bool includeLocalProperties) { var c = new User { DisplayName = DisplayName, Email = Email, Enabled = Enabled, FirstName = FirstName, Id = Id, IsExternal = IsExternal, LastLogIn = LastLogIn, LastName = LastName, Phone = Phone, UserName = UserName, Groups = Groups.Select(x=>x.Clone(includeLocalProperties)).ToList(), }; CopyExtraPropertiesToClone(c, includeLocalProperties); return c; }