This project is read-only.
1

Resolved

Change default behavior of GetList in SPGENListInstance class

description

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

comments

tore7506 wrote Mar 31, 2011 at 11: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 3:13 AM

wrote May 16, 2013 at 8:49 AM

wrote May 16, 2013 at 8:49 AM

wrote Jun 14, 2013 at 7:55 AM