using System; using System.Collections.Generic; using Roblox; using Roblox.Caching; using Roblox.Common; using Roblox.Data.Interfaces; namespace { internal class : IRobloxEntity<, > { private _EntityDAL; public ID { get { return _EntityDAL.ID; } } public () { _EntityDAL = new (); } internal void Delete() { EntityHelper.DeleteEntity( this, _EntityDAL.Delete ); } internal void Save() { EntityHelper.SaveEntity( this, () => { _EntityDAL.Created = DateTime.Now; _EntityDAL.Updated = _EntityDAL.Created; _EntityDAL.Insert(); }, () => { _EntityDAL.Updated = DateTime.Now; _EntityDAL.Update(); } ); } private static CreateNew() { var entity = new (); entity.Save(); return entity; } internal static Get( id) { return EntityHelper.GetEntity<, , >( EntityCacheInfo, id, () => .Get(id) ); } #$@#@ - Unique ID used to find this section, don't change it. 599W#%2 internal static ICollection<> GetsBy( ) { string collectionId = string.Format("GetsBy_:{0}", ); return EntityHelper.GetEntityCollection<, >( EntityCacheInfo, new CacheManager.CachePolicy( CacheManager.CacheScopeFilter.Qualified, string.Format(":{0}", ) ), collectionId, () => DAL.GetIDsBy(), Get ); } #$@#@2 - Unique ID used to find this section, don't change it. 599W#%44 public void Construct( dal) { _EntityDAL = dal; } public CacheInfo CacheInfo { get { return EntityCacheInfo; } } public static CacheInfo EntityCacheInfo = new CacheInfo( new CacheabilitySettings(collectionsAreCacheable: true, countsAreCacheable: true, entityIsCacheable: true, idLookupsAreCacheable: true, hasUnqualifiedCollections: true), typeof().ToString(), true ); public IEnumerable BuildEntityIDLookups() { yield break; } public IEnumerable BuildStateTokenCollection() { %^^^^yield return new StateToken(string.Format(":{0}", ));^^^^% yield break; } } }