Change default behavior of GetList in SPGENListInstance class


I suggest default access to instance should be changed to GetByUrl since it's more safe and consistent way to access list,
or at least it should be configurable.
1) Sometimes list title may be changed by end user
2) I'm not sure access to list should rely on resources
public class SPGENListInstance<TListInstance> : SPGENListInstanceBase where TListInstance : SPGENListInstance<TListInstance>, new()
public override SPList GetList(SPWeb web) { return GetInstanceInternal(web, false, true); } // second param causes resource retrieval routine and call SPWeb.TryGetByTitle
Sent by Robertovich


tore7506 wrote Mar 31, 2011 at 10:49 AM

The new release 1.1.0 the default behavior has changed to the proposed one. The previous implementation was refactored several times due to an unexpected behavior / exception when used together with the SPContext object. Actually, the very first implementation of this method (the early days) had the same implementation as the newer one. I was not able to reproduce the exception after several tests, so I decided to go back and replace this method as proposed. It also has better performance than the previous implementation.

wrote Feb 14, 2013 at 2:13 AM

wrote May 16, 2013 at 7:49 AM

wrote May 16, 2013 at 7:49 AM

wrote Jun 14, 2013 at 6:55 AM