public static System.Data.IDataReader PageDataLoadByUser(CodeFluent.Runtime.PageOptions pageOptions, SoftFluent.Samples.AspNetIdentity1.User user) { if ((user == null)) { return(null); } if ((user.Id == default(string))) { CodeFluent.Runtime.CodeFluentRuntimeException.Throw("invalidEntityKey", "Id", "user", "SoftFluent.Samples.AspNetIdentity1.User"); } CodeFluent.Runtime.CodeFluentPersistence persistence = CodeFluentContext.Get(SoftFluent.Samples.AspNetIdentity1.Constants.SoftFluent_Samples_AspNetIdentity1StoreName).Persistence; persistence.CreateStoredProcedureCommand(null, "ExternalLogin", "LoadByUser"); persistence.AddParameter("@UserId", user.Id, default(string)); if ((pageOptions != null)) { System.Collections.IEnumerator enumerator = pageOptions.OrderByArguments.GetEnumerator(); bool b; int index = 0; for (b = enumerator.MoveNext(); b; b = enumerator.MoveNext()) { CodeFluent.Runtime.OrderByArgument argument = ((CodeFluent.Runtime.OrderByArgument)(enumerator.Current)); persistence.AddParameter(string.Format("@_orderBy{0}", index), argument.Name); persistence.AddParameter(string.Format("@_orderByDirection{0}", index), ((int)(argument.Direction))); index = (index + 1); } } System.Data.IDataReader reader = CodeFluentContext.Get(SoftFluent.Samples.AspNetIdentity1.Constants.SoftFluent_Samples_AspNetIdentity1StoreName).Persistence.ExecuteReader(); return(reader); }
public static System.Data.IDataReader PageDataLoadSpacesSupportBySupport(CodeFluent.Runtime.PageOptions pageOptions, SoftFluent.Json.NET.Support support) { if ((support == null)) { return(null); } if ((support.Id == -1)) { CodeFluent.Runtime.CodeFluentRuntimeException.Throw("invalidEntityKey", "Id", "support", "SoftFluent.Json.NET.Support"); } CodeFluent.Runtime.CodeFluentPersistence persistence = CodeFluentContext.Get(SoftFluent.Json.NET.Constants.SoftFluent_Json_NETStoreName).Persistence; persistence.CreateStoredProcedureCommand(null, "Space", "LoadSpacesSupportBySupport"); persistence.AddParameter("@SupportId", support.Id, ((int)(-1))); if ((pageOptions != null)) { System.Collections.IEnumerator enumerator = pageOptions.OrderByArguments.GetEnumerator(); bool b; int index = 0; for (b = enumerator.MoveNext(); b; b = enumerator.MoveNext()) { CodeFluent.Runtime.OrderByArgument argument = ((CodeFluent.Runtime.OrderByArgument)(enumerator.Current)); persistence.AddParameter(string.Format("@_orderBy{0}", index), argument.Name); persistence.AddParameter(string.Format("@_orderByDirection{0}", index), ((int)(argument.Direction))); index = (index + 1); } } System.Data.IDataReader reader = CodeFluentContext.Get(SoftFluent.Json.NET.Constants.SoftFluent_Json_NETStoreName).Persistence.ExecuteReader(); return(reader); }
public static System.Data.IDataReader PageDataLoadByContactSource(CodeFluent.Runtime.PageOptions pageOptions, SoftFluent.SqlServerInMemory.ContactSource contactSource) { if ((contactSource == null)) { return(null); } if ((contactSource.Id == -1)) { CodeFluent.Runtime.CodeFluentRuntimeException.Throw("invalidEntityKey", "Id", "contactSource", "SoftFluent.SqlServerInMemory.ContactSource"); } CodeFluent.Runtime.CodeFluentPersistence persistence = CodeFluentContext.Get(SoftFluent.SqlServerInMemory.Constants.SoftFluent_SqlServerInMemoryStoreName).Persistence; persistence.CreateStoredProcedureCommand(null, "Customer", "LoadByContactSource"); persistence.AddParameter("@ContactSourceId", contactSource.Id, ((int)(-1))); if ((pageOptions != null)) { System.Collections.IEnumerator enumerator = pageOptions.OrderByArguments.GetEnumerator(); bool b; int index = 0; for (b = enumerator.MoveNext(); b; b = enumerator.MoveNext()) { CodeFluent.Runtime.OrderByArgument argument = ((CodeFluent.Runtime.OrderByArgument)(enumerator.Current)); persistence.AddParameter(string.Format("@_orderBy{0}", index), argument.Name); persistence.AddParameter(string.Format("@_orderByDirection{0}", index), ((int)(argument.Direction))); index = (index + 1); } } System.Data.IDataReader reader = CodeFluentContext.Get(SoftFluent.SqlServerInMemory.Constants.SoftFluent_SqlServerInMemoryStoreName).Persistence.ExecuteReader(); return(reader); }
public static System.Data.IDataReader PageDataLoadByCardNumber(CodeFluent.Runtime.PageOptions pageOptions, string cardNumber) { if ((cardNumber == default(string))) { throw new System.ArgumentNullException("cardNumber"); } CodeFluent.Runtime.CodeFluentPersistence persistence = CodeFluentContext.Get(SoftFluent.Samples.EncryptAspect.Constants.SoftFluent_Samples_EncryptAspectStoreName).Persistence; persistence.CreateStoredProcedureCommand(null, "Customer", "LoadByCardNumber"); persistence.AddParameter("@CardNumber", cardNumber, default(string)); persistence.AddParameter("@PassPhrase", SoftFluent.Samples.EncryptAspect.PassPhrase.GetPassPhrase(), default(string)); if ((pageOptions != null)) { System.Collections.IEnumerator enumerator = pageOptions.OrderByArguments.GetEnumerator(); bool b; int index = 0; for (b = enumerator.MoveNext(); b; b = enumerator.MoveNext()) { CodeFluent.Runtime.OrderByArgument argument = ((CodeFluent.Runtime.OrderByArgument)(enumerator.Current)); persistence.AddParameter(string.Format("@_orderBy{0}", index), argument.Name); persistence.AddParameter(string.Format("@_orderByDirection{0}", index), ((int)(argument.Direction))); index = (index + 1); } } System.Data.IDataReader reader = CodeFluentContext.Get(SoftFluent.Samples.EncryptAspect.Constants.SoftFluent_Samples_EncryptAspectStoreName).Persistence.ExecuteReader(); return(reader); }
public static System.Data.IDataReader PageDataLoadUsersRolesByRole(CodeFluent.Runtime.PageOptions pageOptions, SoftFluent.Samples.AspNetIdentity2.Role role) { if ((role == null)) { return(null); } if ((role.Id.Equals(CodeFluentPersistence.DefaultGuidValue) == true)) { CodeFluent.Runtime.CodeFluentRuntimeException.Throw("invalidEntityKey", "Id", "role", "SoftFluent.Samples.AspNetIdentity2.Role"); } CodeFluent.Runtime.CodeFluentPersistence persistence = CodeFluentContext.Get(SoftFluent.Samples.AspNetIdentity2.Constants.SoftFluent_Samples_AspNetIdentity2StoreName).Persistence; persistence.CreateStoredProcedureCommand(null, "User", "LoadUsersRolesByRole"); persistence.AddParameter("@RoleId", role.Id, CodeFluentPersistence.DefaultGuidValue); if ((pageOptions != null)) { System.Collections.IEnumerator enumerator = pageOptions.OrderByArguments.GetEnumerator(); bool b; int index = 0; for (b = enumerator.MoveNext(); b; b = enumerator.MoveNext()) { CodeFluent.Runtime.OrderByArgument argument = ((CodeFluent.Runtime.OrderByArgument)(enumerator.Current)); persistence.AddParameter(string.Format("@_orderBy{0}", index), argument.Name); persistence.AddParameter(string.Format("@_orderByDirection{0}", index), ((int)(argument.Direction))); index = (index + 1); } } System.Data.IDataReader reader = CodeFluentContext.Get(SoftFluent.Samples.AspNetIdentity2.Constants.SoftFluent_Samples_AspNetIdentity2StoreName).Persistence.ExecuteReader(); return(reader); }
private void LoadAll(int pageIndex, int pageSize, CodeFluent.Runtime.PageOptions pageOptions, System.Data.IDataReader reader) { if ((reader == null)) { throw new System.ArgumentNullException("reader"); } if ((pageIndex < 0)) { pageIndex = 0; } if ((pageSize < 0)) { if ((pageOptions != null)) { pageSize = pageOptions.DefaultPageSize; } else { pageSize = int.MaxValue; } } this.BaseList.Clear(); this.BaseTable.Clear(); int count = 0; int readCount = 0; bool readerRead; for (readerRead = reader.Read(); ((readerRead == true) && ((count < this.MaxCount) && (count < pageSize))); readerRead = reader.Read()) { readCount = (readCount + 1); this.OnCollectionPageAdd(reader, pageIndex, pageSize, pageOptions, readCount, ref count); } }
public static System.Data.IDataReader PageDataLoadRolesUsersByUser(CodeFluent.Runtime.PageOptions pageOptions, ModelCodeFluent.Identity.User user) { if ((user == null)) { return(null); } if ((user.Id.Equals(CodeFluentPersistence.DefaultGuidValue) == true)) { CodeFluent.Runtime.CodeFluentRuntimeException.Throw("invalidEntityKey", "Id", "user", "ModelCodeFluent.Identity.User"); } CodeFluent.Runtime.CodeFluentPersistence persistence = CodeFluentContext.Get(ModelCodeFluent.Constants.ModelCodeFluentStoreName).Persistence; persistence.CreateStoredProcedureCommand(null, "Role", "LoadRolesUsersByUser"); persistence.AddParameter("@UserId", user.Id, CodeFluentPersistence.DefaultGuidValue); if ((pageOptions != null)) { System.Collections.IEnumerator enumerator = pageOptions.OrderByArguments.GetEnumerator(); bool b; int index = 0; for (b = enumerator.MoveNext(); b; b = enumerator.MoveNext()) { CodeFluent.Runtime.OrderByArgument argument = ((CodeFluent.Runtime.OrderByArgument)(enumerator.Current)); persistence.AddParameter(string.Format("@_orderBy{0}", index), argument.Name); persistence.AddParameter(string.Format("@_orderByDirection{0}", index), ((int)(argument.Direction))); index = (index + 1); } } System.Data.IDataReader reader = CodeFluentContext.Get(ModelCodeFluent.Constants.ModelCodeFluentStoreName).Persistence.ExecuteReader(); return(reader); }
private void LoadByList(int pageIndex, int pageSize, CodeFluent.Runtime.PageOptions pageOptions, System.Data.IDataReader reader, DigitalPicnik.List list) { if ((reader == null)) { throw new System.ArgumentNullException("reader"); } if ((pageIndex < 0)) { pageIndex = 0; } if ((pageSize < 0)) { if ((pageOptions != null)) { pageSize = pageOptions.DefaultPageSize; } else { pageSize = int.MaxValue; } } CodeFluent.Runtime.CodeFluentEntityState listState = CodeFluent.Runtime.CodeFluentEntityState.Unchanged; if ((list != null)) { listState = list.EntityState; } this._itemsListList = list; this.BaseList.Clear(); this.BaseTable.Clear(); int count = 0; int readCount = 0; bool readerRead; for (readerRead = reader.Read(); ((readerRead == true) && ((count < this.MaxCount) && (count < pageSize))); readerRead = reader.Read()) { readCount = (readCount + 1); if ((CodeFluent.Runtime.CodeFluentPersistence.CanAddEntity(pageIndex, pageSize, pageOptions, readCount) == true)) { DigitalPicnik.Item item = new DigitalPicnik.Item(); ((CodeFluent.Runtime.ICodeFluentEntity)(item)).ReadRecord(reader); if ((this.BaseContains(item) == false)) { this.BaseAdd(item); count = (count + 1); } item.EntityState = CodeFluent.Runtime.CodeFluentEntityState.Unchanged; } } if ((list != null)) { list.EntityState = listState; } }
private void LoadByContactSource(int pageIndex, int pageSize, CodeFluent.Runtime.PageOptions pageOptions, System.Data.IDataReader reader, SoftFluent.SqlServerInMemory.ContactSource contactSource) { if ((reader == null)) { throw new System.ArgumentNullException("reader"); } if ((pageIndex < 0)) { pageIndex = 0; } if ((pageSize < 0)) { if ((pageOptions != null)) { pageSize = pageOptions.DefaultPageSize; } else { pageSize = int.MaxValue; } } CodeFluent.Runtime.CodeFluentEntityState contactSourceState = CodeFluent.Runtime.CodeFluentEntityState.Unchanged; if ((contactSource != null)) { contactSourceState = contactSource.EntityState; } this._unspecifiedContactSourceContactSource = contactSource; this.BaseList.Clear(); this.BaseTable.Clear(); int count = 0; int readCount = 0; bool readerRead; for (readerRead = reader.Read(); ((readerRead == true) && ((count < this.MaxCount) && (count < pageSize))); readerRead = reader.Read()) { readCount = (readCount + 1); if ((CodeFluent.Runtime.CodeFluentPersistence.CanAddEntity(pageIndex, pageSize, pageOptions, readCount) == true)) { SoftFluent.SqlServerInMemory.Customer customer = new SoftFluent.SqlServerInMemory.Customer(); ((CodeFluent.Runtime.ICodeFluentEntity)(customer)).ReadRecord(reader); if ((this.BaseContains(customer) == false)) { this.BaseAdd(customer); count = (count + 1); } customer.EntityState = CodeFluent.Runtime.CodeFluentEntityState.Unchanged; } } if ((contactSource != null)) { contactSource.EntityState = contactSourceState; } }
private void LoadUsersRolesByRole(int pageIndex, int pageSize, CodeFluent.Runtime.PageOptions pageOptions, System.Data.IDataReader reader, SoftFluent.Samples.AspNetIdentity2.Role role) { if ((reader == null)) { throw new System.ArgumentNullException("reader"); } if ((pageIndex < 0)) { pageIndex = 0; } if ((pageSize < 0)) { if ((pageOptions != null)) { pageSize = pageOptions.DefaultPageSize; } else { pageSize = int.MaxValue; } } CodeFluent.Runtime.CodeFluentEntityState roleState = CodeFluent.Runtime.CodeFluentEntityState.Unchanged; if ((role != null)) { roleState = role.EntityState; } this._usersRoleRoles = role; this.BaseList.Clear(); this.BaseTable.Clear(); int count = 0; int readCount = 0; bool readerRead; for (readerRead = reader.Read(); ((readerRead == true) && ((count < this.MaxCount) && (count < pageSize))); readerRead = reader.Read()) { readCount = (readCount + 1); if ((CodeFluent.Runtime.CodeFluentPersistence.CanAddEntity(pageIndex, pageSize, pageOptions, readCount) == true)) { SoftFluent.Samples.AspNetIdentity2.User user = new SoftFluent.Samples.AspNetIdentity2.User(); ((CodeFluent.Runtime.ICodeFluentEntity)(user)).ReadRecord(reader); if ((this.BaseContains(user) == false)) { this.BaseAdd(user); count = (count + 1); } user.EntityState = CodeFluent.Runtime.CodeFluentEntityState.Unchanged; } } if ((role != null)) { role.EntityState = roleState; } }
private void LoadSupportSpacesBySpace(int pageIndex, int pageSize, CodeFluent.Runtime.PageOptions pageOptions, System.Data.IDataReader reader, SoftFluent.Json.NET.Space space) { if ((reader == null)) { throw new System.ArgumentNullException("reader"); } if ((pageIndex < 0)) { pageIndex = 0; } if ((pageSize < 0)) { if ((pageOptions != null)) { pageSize = pageOptions.DefaultPageSize; } else { pageSize = int.MaxValue; } } CodeFluent.Runtime.CodeFluentEntityState spaceState = CodeFluent.Runtime.CodeFluentEntityState.Unchanged; if ((space != null)) { spaceState = space.EntityState; } this._supportSpaceSpaces = space; this.BaseList.Clear(); this.BaseTable.Clear(); int count = 0; int readCount = 0; bool readerRead; for (readerRead = reader.Read(); ((readerRead == true) && ((count < this.MaxCount) && (count < pageSize))); readerRead = reader.Read()) { readCount = (readCount + 1); if ((CodeFluent.Runtime.CodeFluentPersistence.CanAddEntity(pageIndex, pageSize, pageOptions, readCount) == true)) { SoftFluent.Json.NET.Support support = new SoftFluent.Json.NET.Support(); ((CodeFluent.Runtime.ICodeFluentEntity)(support)).ReadRecord(reader); if ((this.BaseContains(support) == false)) { this.BaseAdd(support); count = (count + 1); } support.EntityState = CodeFluent.Runtime.CodeFluentEntityState.Unchanged; } } if ((space != null)) { space.EntityState = spaceState; } }
private void LoadRolesUsersByUser(int pageIndex, int pageSize, CodeFluent.Runtime.PageOptions pageOptions, System.Data.IDataReader reader, ModelCodeFluent.Identity.User user) { if ((reader == null)) { throw new System.ArgumentNullException("reader"); } if ((pageIndex < 0)) { pageIndex = 0; } if ((pageSize < 0)) { if ((pageOptions != null)) { pageSize = pageOptions.DefaultPageSize; } else { pageSize = int.MaxValue; } } CodeFluent.Runtime.CodeFluentEntityState userState = CodeFluent.Runtime.CodeFluentEntityState.Unchanged; if ((user != null)) { userState = user.EntityState; } this._rolesUserUsers = user; this.BaseList.Clear(); this.BaseTable.Clear(); int count = 0; int readCount = 0; bool readerRead; for (readerRead = reader.Read(); ((readerRead == true) && ((count < this.MaxCount) && (count < pageSize))); readerRead = reader.Read()) { readCount = (readCount + 1); if ((CodeFluent.Runtime.CodeFluentPersistence.CanAddEntity(pageIndex, pageSize, pageOptions, readCount) == true)) { ModelCodeFluent.Identity.Role role = new ModelCodeFluent.Identity.Role(); ((CodeFluent.Runtime.ICodeFluentEntity)(role)).ReadRecord(reader); if ((this.BaseContains(role) == false)) { this.BaseAdd(role); count = (count + 1); } role.EntityState = CodeFluent.Runtime.CodeFluentEntityState.Unchanged; } } if ((user != null)) { user.EntityState = userState; } }
private void LoadAll(int pageIndex, int pageSize, CodeFluent.Runtime.PageOptions pageOptions, System.Data.IDataReader reader) { if ((reader == null)) { throw new System.ArgumentNullException("reader"); } if ((pageIndex < 0)) { pageIndex = 0; } if ((pageSize < 0)) { if ((pageOptions != null)) { pageSize = pageOptions.DefaultPageSize; } else { pageSize = int.MaxValue; } } this._contactsUserUser = null; this.BaseList.Clear(); this.BaseTable.Clear(); int count = 0; int readCount = 0; bool readerRead; for (readerRead = reader.Read(); ((readerRead == true) && ((count < this.MaxCount) && (count < pageSize))); readerRead = reader.Read()) { readCount = (readCount + 1); if ((CodeFluent.Runtime.CodeFluentPersistence.CanAddEntity(pageIndex, pageSize, pageOptions, readCount) == true)) { SoftFluent.Samples.ComponentOne.Contact contact = new SoftFluent.Samples.ComponentOne.Contact(); ((CodeFluent.Runtime.ICodeFluentEntity)(contact)).ReadRecord(reader); if ((this.BaseContains(contact) == false)) { this.BaseAdd(contact); count = (count + 1); } contact.EntityState = CodeFluent.Runtime.CodeFluentEntityState.Unchanged; } } }
private void Search(int pageIndex, int pageSize, CodeFluent.Runtime.PageOptions pageOptions, System.Data.IDataReader reader, int id, string email, string firstName, string lastName) { if ((reader == null)) { throw new System.ArgumentNullException("reader"); } if ((pageIndex < 0)) { pageIndex = 0; } if ((pageSize < 0)) { if ((pageOptions != null)) { pageSize = pageOptions.DefaultPageSize; } else { pageSize = int.MaxValue; } } this.BaseList.Clear(); this.BaseTable.Clear(); int count = 0; int readCount = 0; bool readerRead; for (readerRead = reader.Read(); ((readerRead == true) && ((count < this.MaxCount) && (count < pageSize))); readerRead = reader.Read()) { readCount = (readCount + 1); if ((CodeFluent.Runtime.CodeFluentPersistence.CanAddEntity(pageIndex, pageSize, pageOptions, readCount) == true)) { ContactManager.User user = new ContactManager.User(); ((CodeFluent.Runtime.ICodeFluentEntity)(user)).ReadRecord(reader); if ((this.BaseContains(user) == false)) { this.BaseAdd(user); count = (count + 1); } user.EntityState = CodeFluent.Runtime.CodeFluentEntityState.Unchanged; } } }
private void LoadAll(int pageIndex, int pageSize, CodeFluent.Runtime.PageOptions pageOptions, System.Data.IDataReader reader) { if ((reader == null)) { throw new System.ArgumentNullException("reader"); } if ((pageIndex < 0)) { pageIndex = 0; } if ((pageSize < 0)) { if ((pageOptions != null)) { pageSize = pageOptions.DefaultPageSize; } else { pageSize = int.MaxValue; } } this.BaseList.Clear(); int count = 0; int readCount = 0; bool readerRead; for (readerRead = reader.Read(); ((readerRead == true) && ((count < this.MaxCount) && (count < pageSize))); readerRead = reader.Read()) { readCount = (readCount + 1); if ((CodeFluent.Runtime.CodeFluentPersistence.CanAddEntity(pageIndex, pageSize, pageOptions, readCount) == true)) { ContactManager.Address address = new ContactManager.Address(); ((CodeFluent.Runtime.ICodeFluentEntity)(address)).ReadRecord(reader); if ((this.BaseContains(address) == false)) { this.BaseAdd(address); count = (count + 1); } address.EntityState = CodeFluent.Runtime.CodeFluentEntityState.Unchanged; } } }
public static System.Data.IDataReader PageDataLoadAll(CodeFluent.Runtime.PageOptions pageOptions) { CodeFluent.Runtime.CodeFluentPersistence persistence = CodeFluentContext.Get(SoftFluent.SqlServerInMemory.Constants.SoftFluent_SqlServerInMemoryStoreName).Persistence; persistence.CreateStoredProcedureCommand(null, "Customer", "LoadAll"); if ((pageOptions != null)) { System.Collections.IEnumerator enumerator = pageOptions.OrderByArguments.GetEnumerator(); bool b; int index = 0; for (b = enumerator.MoveNext(); b; b = enumerator.MoveNext()) { CodeFluent.Runtime.OrderByArgument argument = ((CodeFluent.Runtime.OrderByArgument)(enumerator.Current)); persistence.AddParameter(string.Format("@_orderBy{0}", index), argument.Name); persistence.AddParameter(string.Format("@_orderByDirection{0}", index), ((int)(argument.Direction))); index = (index + 1); } } System.Data.IDataReader reader = CodeFluentContext.Get(SoftFluent.SqlServerInMemory.Constants.SoftFluent_SqlServerInMemoryStoreName).Persistence.ExecuteReader(); return(reader); }
public static System.Data.IDataReader PageDataLoadAll(CodeFluent.Runtime.PageOptions pageOptions) { CodeFluent.Runtime.CodeFluentPersistence persistence = CodeFluentContext.Get(SoftFluent.Samples.RedisCache.Constants.SoftFluent_Samples_RedisCacheStoreName).Persistence; persistence.CreateStoredProcedureCommand(null, "Category", "LoadAll"); persistence.AddParameter("@Lcid", System.Threading.Thread.CurrentThread.CurrentUICulture.LCID, ((int)(1033))); if ((pageOptions != null)) { System.Collections.IEnumerator enumerator = pageOptions.OrderByArguments.GetEnumerator(); bool b; int index = 0; for (b = enumerator.MoveNext(); b; b = enumerator.MoveNext()) { CodeFluent.Runtime.OrderByArgument argument = ((CodeFluent.Runtime.OrderByArgument)(enumerator.Current)); persistence.AddParameter(string.Format("@_orderBy{0}", index), argument.Name); persistence.AddParameter(string.Format("@_orderByDirection{0}", index), ((int)(argument.Direction))); index = (index + 1); } } System.Data.IDataReader reader = CodeFluentContext.Get(SoftFluent.Samples.RedisCache.Constants.SoftFluent_Samples_RedisCacheStoreName).Persistence.ExecuteReader(); return(reader); }
public static System.Data.IDataReader PageDataSearch(CodeFluent.Runtime.PageOptions pageOptions, int id, string email, string firstName, string lastName) { CodeFluent.Runtime.CodeFluentPersistence persistence = CodeFluentContext.Get(ContactManager.Constants.ContactManagerStoreName).Persistence; persistence.CreateStoredProcedureCommand(null, "User", "Search"); persistence.AddParameter("@Id", id, ((int)(-1))); persistence.AddParameter("@Email", email, default(string)); persistence.AddParameter("@FirstName", firstName, default(string)); persistence.AddParameter("@LastName", lastName, default(string)); if ((pageOptions != null)) { System.Collections.IEnumerator enumerator = pageOptions.OrderByArguments.GetEnumerator(); bool b; int index = 0; for (b = enumerator.MoveNext(); b; b = enumerator.MoveNext()) { CodeFluent.Runtime.OrderByArgument argument = ((CodeFluent.Runtime.OrderByArgument)(enumerator.Current)); persistence.AddParameter(string.Format("@_orderBy{0}", index), argument.Name); persistence.AddParameter(string.Format("@_orderByDirection{0}", index), ((int)(argument.Direction))); index = (index + 1); } } System.Data.IDataReader reader = CodeFluentContext.Get(ContactManager.Constants.ContactManagerStoreName).Persistence.ExecuteReader(); return(reader); }
public static DigitalPicnik.ListCollection PageLoadAll(int pageIndex, int pageSize, CodeFluent.Runtime.PageOptions pageOptions) { if ((pageIndex < 0)) { pageIndex = 0; } if ((pageSize < 0)) { if ((pageOptions != null)) { pageSize = pageOptions.DefaultPageSize; } else { pageSize = int.MaxValue; } } DigitalPicnik.ListCollection ret = new DigitalPicnik.ListCollection(); System.Data.IDataReader reader = null; try { reader = DigitalPicnik.ListCollection.PageDataLoadAll(pageOptions); if ((reader == null)) { return(ret); } ret.LoadAll(pageIndex, pageSize, pageOptions, reader); } finally { if ((reader != null)) { reader.Dispose(); } CodeFluent.Runtime.CodeFluentPersistence.CompleteCommand(DigitalPicnik.Constants.DigitalPicnikStoreName); } return(ret); }
public static ContactManager.UserCollection PageSearch(int pageIndex, int pageSize, CodeFluent.Runtime.PageOptions pageOptions, int id, string email, string firstName, string lastName) { if ((pageIndex < 0)) { pageIndex = 0; } if ((pageSize < 0)) { if ((pageOptions != null)) { pageSize = pageOptions.DefaultPageSize; } else { pageSize = int.MaxValue; } } ContactManager.UserCollection ret = new ContactManager.UserCollection(); System.Data.IDataReader reader = null; try { reader = ContactManager.UserCollection.PageDataSearch(pageOptions, id, email, firstName, lastName); if ((reader == null)) { return(ret); } ret.Search(pageIndex, pageSize, pageOptions, reader, id, email, firstName, lastName); } finally { if ((reader != null)) { reader.Dispose(); } CodeFluent.Runtime.CodeFluentPersistence.CompleteCommand(ContactManager.Constants.ContactManagerStoreName); } return(ret); }
public static ModelCodeFluent.Identity.RoleCollection PageLoadRolesUsersByUser(int pageIndex, int pageSize, CodeFluent.Runtime.PageOptions pageOptions, ModelCodeFluent.Identity.User user) { if ((pageIndex < 0)) { pageIndex = 0; } if ((pageSize < 0)) { if ((pageOptions != null)) { pageSize = pageOptions.DefaultPageSize; } else { pageSize = int.MaxValue; } } ModelCodeFluent.Identity.RoleCollection ret = new ModelCodeFluent.Identity.RoleCollection(); System.Data.IDataReader reader = null; try { reader = ModelCodeFluent.Identity.RoleCollection.PageDataLoadRolesUsersByUser(pageOptions, user); if ((reader == null)) { return(ret); } ret.LoadRolesUsersByUser(pageIndex, pageSize, pageOptions, reader, user); } finally { if ((reader != null)) { reader.Dispose(); } CodeFluent.Runtime.CodeFluentPersistence.CompleteCommand(ModelCodeFluent.Constants.ModelCodeFluentStoreName); } return(ret); }
// CacheManager0 private static SoftFluent.Samples.RedisCache.CategoryCollection CachePageLoadAll(bool useCache, int pageIndex, int pageSize, CodeFluent.Runtime.PageOptions pageOptions) { if ((pageIndex < 0)) { pageIndex = 0; } if ((pageSize < 0)) { if ((pageOptions != null)) { pageSize = pageOptions.DefaultPageSize; } else { pageSize = int.MaxValue; } } SoftFluent.Samples.RedisCache.CategoryCollection ret = null; string cacheKey = null; if ((useCache == true)) { cacheKey = CodeFluent.Runtime.Caching.SimpleCacheManager.BuildCacheKey("69d80ec93c1e64a950b65ea0729f45bc", pageIndex, pageSize, pageOptions); ret = SoftFluent.Samples.RedisCache.Caching.CacheManager0.Manager.Get("SoftFluent.Samples.RedisCache.Category", cacheKey) as SoftFluent.Samples.RedisCache.CategoryCollection; if ((ret != null)) { return(ret); } } ret = new SoftFluent.Samples.RedisCache.CategoryCollection(); System.Data.IDataReader reader = null; try { reader = SoftFluent.Samples.RedisCache.CategoryCollection.PageDataLoadAll(pageOptions); if ((reader == null)) { if ((useCache == true)) { SoftFluent.Samples.RedisCache.Caching.CacheManager0.Manager.Add("SoftFluent.Samples.RedisCache.Category", cacheKey, ret, null); } return(ret); } ret.LoadAll(pageIndex, pageSize, pageOptions, reader); } finally { if ((reader != null)) { reader.Dispose(); } CodeFluent.Runtime.CodeFluentPersistence.CompleteCommand(SoftFluent.Samples.RedisCache.Constants.SoftFluent_Samples_RedisCacheStoreName); } if ((useCache == true)) { SoftFluent.Samples.RedisCache.Caching.CacheManager0.Manager.Add("SoftFluent.Samples.RedisCache.Category", cacheKey, ret, null); } return(ret); }
public static ContactManager.Proxy.UserCollection PageSearch(int pageIndex, int pageSize, CodeFluent.Runtime.PageOptions pageOptions, int id, string email, string firstName, string lastName) { ContactManager.Proxy.UserCollection collection = ContactManager.Proxy.User.WcfClient.Current.Channel.PageSearch(pageIndex, pageSize, pageOptions, id, email, firstName, lastName); return(collection); }
public static SoftFluent.Samples.RedisCache.CategoryCollection NoCachePageLoadAll(int pageIndex, int pageSize, CodeFluent.Runtime.PageOptions pageOptions) { return(CategoryCollection.CachePageLoadAll(false, pageIndex, pageSize, pageOptions)); }
public static SoftFluent.SqlServerInMemory.CustomerCollection PageLoadByContactSource(int pageIndex, int pageSize, CodeFluent.Runtime.PageOptions pageOptions, SoftFluent.SqlServerInMemory.ContactSource contactSource) { if ((pageIndex < 0)) { pageIndex = 0; } if ((pageSize < 0)) { if ((pageOptions != null)) { pageSize = pageOptions.DefaultPageSize; } else { pageSize = int.MaxValue; } } SoftFluent.SqlServerInMemory.CustomerCollection ret = new SoftFluent.SqlServerInMemory.CustomerCollection(); System.Data.IDataReader reader = null; try { reader = SoftFluent.SqlServerInMemory.CustomerCollection.PageDataLoadByContactSource(pageOptions, contactSource); if ((reader == null)) { return(ret); } ret.LoadByContactSource(pageIndex, pageSize, pageOptions, reader, contactSource); } finally { if ((reader != null)) { reader.Dispose(); } CodeFluent.Runtime.CodeFluentPersistence.CompleteCommand(SoftFluent.SqlServerInMemory.Constants.SoftFluent_SqlServerInMemoryStoreName); } return(ret); }
public static SoftFluent.Samples.StoreEnumAsText.SampleCollection PageLoadAll(int pageIndex, int pageSize, CodeFluent.Runtime.PageOptions pageOptions) { if ((pageIndex < 0)) { pageIndex = 0; } if ((pageSize < 0)) { if ((pageOptions != null)) { pageSize = pageOptions.DefaultPageSize; } else { pageSize = int.MaxValue; } } SoftFluent.Samples.StoreEnumAsText.SampleCollection ret = new SoftFluent.Samples.StoreEnumAsText.SampleCollection(); System.Data.IDataReader reader = null; try { reader = SoftFluent.Samples.StoreEnumAsText.SampleCollection.PageDataLoadAll(pageOptions); if ((reader == null)) { return(ret); } ret.LoadAll(pageIndex, pageSize, pageOptions, reader); } finally { if ((reader != null)) { reader.Dispose(); } CodeFluent.Runtime.CodeFluentPersistence.CompleteCommand(SoftFluent.Samples.StoreEnumAsText.Constants.SoftFluent_Samples_StoreEnumAsTextStoreName); } return(ret); }
public UserCollection(string contextName, System.ServiceModel.Channels.IChannel channel, string pageMethodName, CodeFluent.Runtime.PageOptions pageOptions, params object[] arguments) : base(contextName, channel, pageMethodName, pageOptions, arguments) { }
private void OnCollectionPageAdd(System.Data.IDataReader reader, int pageIndex, int pageSize, CodeFluent.Runtime.PageOptions pageOptions, int readCount, ref int count) { SoftFluent.Samples.RedisCache.Category item = new SoftFluent.Samples.RedisCache.Category(); ((CodeFluent.Runtime.ICodeFluentEntity)item).ReadRecord(reader); if ((pageSize >= 0) && (pageSize != int.MaxValue)) // paged mode, use a skip cache { if (readCount == 1) // first item init cache { _onCollectionPages = new CodeFluent.Runtime.Utilities.DistinctDictionary <string>(); } if (_onCollectionPages.Count < (pageIndex * pageSize)) { if (!_onCollectionPages.Contains(item.EntityKey)) { _onCollectionPages.Add(item.EntityKey); } return; } if (_onCollectionPages.Contains(item.EntityKey)) { return; } } if (BaseContains(item)) { return; } BaseAdd(item); item.EntityState = CodeFluent.Runtime.CodeFluentEntityState.Unchanged; count++; }
public static SoftFluent.Json.NET.SupportCollection PageLoadSupportSpacesBySpace(int pageIndex, int pageSize, CodeFluent.Runtime.PageOptions pageOptions, SoftFluent.Json.NET.Space space) { if ((pageIndex < 0)) { pageIndex = 0; } if ((pageSize < 0)) { if ((pageOptions != null)) { pageSize = pageOptions.DefaultPageSize; } else { pageSize = int.MaxValue; } } SoftFluent.Json.NET.SupportCollection ret = new SoftFluent.Json.NET.SupportCollection(); System.Data.IDataReader reader = null; try { reader = SoftFluent.Json.NET.SupportCollection.PageDataLoadSupportSpacesBySpace(pageOptions, space); if ((reader == null)) { return(ret); } ret.LoadSupportSpacesBySpace(pageIndex, pageSize, pageOptions, reader, space); } finally { if ((reader != null)) { reader.Dispose(); } CodeFluent.Runtime.CodeFluentPersistence.CompleteCommand(SoftFluent.Json.NET.Constants.SoftFluent_Json_NETStoreName); } return(ret); }
public static ContactManager.Proxy.UserCollection PageLoadAll(int pageIndex, int pageSize, CodeFluent.Runtime.PageOptions pageOptions) { ContactManager.Proxy.UserCollection collection = ContactManager.Proxy.User.WcfClient.Current.Channel.PageLoadAll(pageIndex, pageSize, pageOptions); return(collection); }