public ILocatorState Get(string id) { ILocatorState state = CurrentSession.Get <LocatorState> (id); if (state == null) { state = new LocatorState(); (state as LocatorState).LocatorId = id; } return(state); }
public static IEnumerable <ILocatorState> ToLocatorStateCollection(IEnumerable <string> ids) { var states = new List <LocatorState>(); foreach (var id in ids) { var s = new LocatorState(); s.LocatorId = id; states.Add(s); } return(states); }
public ILocatorState Get(string id, bool nullAllowed) { ILocatorState state = CurrentSession.Get <LocatorState> (id); if (!nullAllowed && state == null) { state = new LocatorState(); (state as LocatorState).LocatorId = id; } if (ReadOnlyProxyGenerator != null && state != null) { return(ReadOnlyProxyGenerator.CreateProxy <ILocatorState>(state, new Type[] { }, _readOnlyPropertyNames)); } return(state); }