/examples/EFTester/Acme.TestModel/Business/Objects/OneToOneParentCollection.Generated.cs
C# | 1383 lines | 785 code | 143 blank | 455 comment | 92 complexity | ff7a4f2d5264dd72f9188a464d83f636 MD5 | raw file
Possible License(s): JSON, CC-BY-SA-3.0
- using System;
- using System.Data;
- using System.Xml;
- using System.Collections;
- using System.Runtime.Serialization;
- using System.ComponentModel;
- using Acme.TestModel.Business.Rules;
- using Acme.TestModel.Business.SelectCommands;
- using Acme.TestModel.Domain.Objects;
- using Widgetsphere.Core.DataAccess;
- using Widgetsphere.Core.Util;
- using Widgetsphere.Core.Logging;
- using Widgetsphere.Core.Exceptions;
- using Acme.TestModel.Business.LINQ;
- using System.IO;
- using System.Collections.Generic;
- using System.Linq.Expressions;
- using System.Data.Linq;
- using System.Linq;
- using System.Text;
- using Widgetsphere.Core.EventArgs;
- using System.Text.RegularExpressions;
-
- namespace Acme.TestModel.Business.Objects
- {
- /// <summary>
- /// The collection to hold 'OneToOneParent' entities
- /// </summary>
- [Serializable()]
- public partial class OneToOneParentCollection : Widgetsphere.Core.DataAccess.BusinessCollectionPersistableBase, Widgetsphere.Core.DataAccess.IPersistableBusinessCollection, System.IDisposable, System.ComponentModel.IListSource, System.Collections.IList, System.Collections.IEnumerator, System.Collections.Generic.IEnumerable<Acme.TestModel.Business.Objects.OneToOneParent>, Widgetsphere.Core.DataAccess.IWrappingClass
- {
- #region Member Variables
-
- internal DomainOneToOneParentCollection wrappedClass;
-
- /// <summary>
- /// The parent subdomain object
- /// </summary>
- protected SubDomain _subDomain = null;
-
- #endregion
-
- #region Constructor / Initialize
-
- internal OneToOneParentCollection(DomainOneToOneParentCollection classToWrap)
- {
- _subDomain = classToWrap.SubDomain;
- wrappedClass = classToWrap;
- }
-
- /// <summary>
- /// Constructor that enables you to specify a modifier
- /// </summary>
- /// <param name="modifier">Used in audit operations to track changes</param>
- public OneToOneParentCollection(string modifier)
- {
- _subDomain = new SubDomain(modifier);
- ResetWrappedClass((DomainOneToOneParentCollection)_subDomain.GetDomainCollection(Collections.OneToOneParentCollection));
- }
-
- /// <summary>
- /// The default constructor
- /// </summary>
- public OneToOneParentCollection()
- {
- _subDomain = new SubDomain(ConfigurationValues.GetInstance().Modifier);
- ResetWrappedClass((DomainOneToOneParentCollection)_subDomain.GetDomainCollection(Collections.OneToOneParentCollection));
- }
-
- #endregion
-
- #region Property Implementations
-
- /// <summary>
- /// Returns the internal object that this object wraps
- /// </summary>
- [System.ComponentModel.Browsable(false)]
- internal virtual object WrappedClass
- {
- get { return wrappedClass ; }
- set { wrappedClass = (DomainOneToOneParentCollection)value ; }
- }
-
- //WrappingClass Interface
- object Widgetsphere.Core.DataAccess.IWrappingClass.WrappedClass
- {
- get { return this.WrappedClass; }
- set { this.WrappedClass = value; }
- }
-
- /// <summary>
- /// Specifies a modifier string to be used in the audit functionality
- /// </summary>
- public string Modifier
- {
- get
- {
- try
- {
- return wrappedClass.Modifier;
- }
- catch (System.Data.DBConcurrencyException dbcex) { throw new Widgetsphere.Core.Exceptions.ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
- catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new Widgetsphere.Core.Exceptions.UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
- catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
- }
- internal set { wrappedClass.Modifier = value; }
- }
-
- /// <summary>
- /// A reference to the SubDomain that holds this collection
- /// </summary>
- public SubDomain SubDomain
- {
- get
- {
- try
- {
- return wrappedClass.SubDomain;
- }
- catch (System.Data.DBConcurrencyException dbcex) { throw new Widgetsphere.Core.Exceptions.ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
- catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new Widgetsphere.Core.Exceptions.UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
- catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
- }
- }
-
- /// <summary>
- /// Returns the number of items in this collection
- /// </summary>
- public override int Count
- {
- get
- {
- try
- {
- lock (wrappedClass.SubDomain)
- {
- DataTable dt = wrappedClass.GetChanges(DataRowState.Deleted);
- if (dt == null) return wrappedClass.Count;
- else return wrappedClass.Count - dt.Rows.Count;
- }
- }
- catch (System.Data.DBConcurrencyException dbcex) { throw new Widgetsphere.Core.Exceptions.ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
- catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new Widgetsphere.Core.Exceptions.UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
- catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
- }
- }
-
- /// <summary>
- /// Determines the type of object contained by this collection.
- /// </summary>
- public virtual Type ContainedType
- {
- get { return typeof(OneToOneParent); }
- }
-
- /// <summary>
- /// Determines the type of collection for this object.
- /// </summary>
- public virtual Collections Collection
- {
- get { return Collections.OneToOneParentCollection; }
- }
-
- #endregion
-
- #region Enumerator
-
- /// <summary>
- /// Gets or sets the element at the specified index.
- /// </summary>
- /// <param name="index">The zero-based index of the element to get or set. </param>
- /// <returns>The element at the specified index.</returns>
- public virtual OneToOneParent this[int index]
- {
- get
- {
- try
- {
- var internalEnumerator = this.GetEnumerator();
- internalEnumerator.Reset();
- int ii = -1;
- while(ii < index)
- {
- internalEnumerator.MoveNext();
- ii++;
- }
- var retval = (OneToOneParent)internalEnumerator.Current;
- if (retval.wrappedClass == null)
- {
- if (!((0 <= index) && (index < this.Count)))
- throw new IndexOutOfRangeException();
- else
- throw new Exception("The item is null. This is not a valid state.");
- }
- else return (OneToOneParent)internalEnumerator.Current;
- }
- catch (System.Data.DBConcurrencyException dbcex) { throw new Widgetsphere.Core.Exceptions.ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
- catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new Widgetsphere.Core.Exceptions.UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
- catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
- }
- }
-
- #endregion
-
- #region Methods
-
- /// <summary>
- /// Create a new object to later add to this collection
- /// </summary>
- public virtual OneToOneParent NewItem(int UserId)
- {
- try
- {
- lock (wrappedClass.SubDomain)
- {
- return new OneToOneParent(wrappedClass.NewItem(UserId));
- }
- }
- catch (System.Data.DBConcurrencyException dbcex) { throw new Widgetsphere.Core.Exceptions.ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
- catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new Widgetsphere.Core.Exceptions.UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
- catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
- }
-
- /// <summary>
- /// Create a new object to later add to this collection
- /// </summary>
- public virtual OneToOneParent NewItem()
- {
- try
- {
- lock (wrappedClass.SubDomain)
- {
- return new OneToOneParent(wrappedClass.NewItem());
- }
- }
- catch (System.Data.DBConcurrencyException dbcex) { throw new Widgetsphere.Core.Exceptions.ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
- catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new Widgetsphere.Core.Exceptions.UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
- catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
- }
-
- /// <summary>
- /// Add a newly created entity to this collection.
- /// </summary>
- public virtual void AddItem(OneToOneParent item)
- {
- try
- {
- lock (wrappedClass.SubDomain)
- {
- wrappedClass.AddItem((DomainOneToOneParent)item.WrappedClass);
- }
- }
- catch (System.Data.DBConcurrencyException dbcex) { throw new Widgetsphere.Core.Exceptions.ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
- catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new Widgetsphere.Core.Exceptions.UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
- catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
- }
-
- /// <summary>
- /// Determines if the specified item exists in this list
- /// </summary>
- /// <param name="item"></param>
- /// <returns></returns>
- public virtual bool Contains(Acme.TestModel.Business.Objects.OneToOneParent item)
- {
- foreach (var o in this)
- {
- if (o == item) return true;
- }
- return false;
- }
-
- /// <summary>
- /// Determines the position in the list of the specified item, if it exists
- /// </summary>
- /// <param name="item"></param>
- /// <returns></returns>
- public virtual int IndexOf(Acme.TestModel.Business.Objects.OneToOneParent item)
- {
- int index = 0;
- foreach (var o in this)
- {
- if (o == item) return index;
- index++;
- }
- return -1;
- }
-
- #region IListSource Members
-
- bool System.ComponentModel.IListSource.ContainsListCollection
- {
- get { return true; }
- }
-
- System.Collections.IList System.ComponentModel.IListSource.GetList()
- {
- var list = new System.Collections.Generic.List<Acme.TestModel.Business.Objects.OneToOneParent>();
- list.AddRange(this);
- return list;
- }
-
- #endregion
-
- #region IList Members
-
- int System.Collections.IList.Add(object value)
- {
- if (!(value is Acme.TestModel.Business.Objects.OneToOneParent))
- throw new System.Exception("The specified type is not valid!");
- var item = value as Acme.TestModel.Business.Objects.OneToOneParent;
- this.AddItem(item);
- return this.Count;
- }
-
- void System.Collections.IList.Clear()
- {
- throw new System.NotImplementedException();
- }
-
- bool System.Collections.IList.Contains(object value)
- {
- if (!(value is Acme.TestModel.Business.Objects.OneToOneParent))
- throw new System.Exception("The specified type is not valid!");
- var item = value as Acme.TestModel.Business.Objects.OneToOneParent;
- return this.Contains(item);
- }
-
- int System.Collections.IList.IndexOf(object value)
- {
- if (!(value is Acme.TestModel.Business.Objects.OneToOneParent))
- throw new System.Exception("The specified type is not valid!");
- var item = value as Acme.TestModel.Business.Objects.OneToOneParent;
- return this.IndexOf(item);
- }
-
- void System.Collections.IList.Insert(int index, object value)
- {
- throw new System.NotImplementedException();
- }
-
- bool System.Collections.IList.IsFixedSize
- {
- get { return false; }
- }
-
- bool System.Collections.IList.IsReadOnly
- {
- get { return false; }
- }
-
- void System.Collections.IList.Remove(object value)
- {
- if (!(value is Acme.TestModel.Business.Objects.OneToOneParent))
- throw new System.Exception("The specified type is not valid!");
- var item = value as Acme.TestModel.Business.Objects.OneToOneParent;
- if (this.Contains(item))
- item.Delete();
- }
-
- void System.Collections.IList.RemoveAt(int index)
- {
- if ((0 <= index) && (index < this.Count))
- this[index].Delete();
- }
-
- object System.Collections.IList.this[int index]
- {
- get { return this[index]; }
- set { throw new System.NotImplementedException(); }
- }
-
- #endregion
-
- /// <summary>
- /// Takes an IVisitor object and iterates through each item in this collection
- /// </summary>
- /// <param name="visitor">The object that processes each collection item</param>
- public virtual void ProcessVisitor(IVisitor visitor)
- {
- if (visitor == null) throw new Exception("This object cannot be null.");
- lock(this)
- {
- foreach (IBusinessObject item in this)
- {
- visitor.Visit(item);
- }
- }
- }
-
- #region Static SQL Methods
-
- internal static string GetFieldAliasFromFieldNameSqlMapping(string alias)
- {
- alias = alias.Replace("[", string.Empty).Replace("]", string.Empty);
- switch (alias.ToLower())
- {
- case "first_name": return "firstname";
- case "user_id": return "userid";
- default: throw new Exception("The select clause is not valid.");
- }
- }
-
- internal static string GetTableFromFieldAliasSqlMapping(string alias)
- {
- switch (alias.ToLower())
- {
- case "firstname": return "ONE_TO_ONE_PARENT";
- case "userid": return "ONE_TO_ONE_PARENT";
- default: throw new Exception("The select clause is not valid.");
- }
- }
-
- internal static string GetTableFromFieldNameSqlMapping(string field)
- {
- switch (field.ToLower())
- {
- case "first_name": return "ONE_TO_ONE_PARENT";
- case "user_id": return "ONE_TO_ONE_PARENT";
- default: throw new Exception("The select clause is not valid.");
- }
- }
-
- internal static string GetRemappedLinqSql(string sql, string parentAlias, LinqSQLFromClauseCollection childTables)
- {
- sql = System.Text.RegularExpressions.Regex.Replace(sql, "\\[" + parentAlias + "\\]\\.\\[first_name\\]", "[" + childTables.GetBaseAliasTable(parentAlias, "ONE_TO_ONE_PARENT") + "].[first_name]", RegexOptions.IgnoreCase);
- sql = System.Text.RegularExpressions.Regex.Replace(sql, "\\[" + parentAlias + "\\]\\.\\[user_id\\]", "[" + childTables.GetBaseAliasTable(parentAlias, "ONE_TO_ONE_PARENT") + "].[user_id]", RegexOptions.IgnoreCase);
- return sql;
- }
-
- internal static string GetPagedSQL(List<LinqSQLField> fieldList, LinqSQLFromClauseCollection fromLinkList, string whereClause, object paging, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- var sb = new StringBuilder();
- var paging2 = (OneToOneParentPaging)paging;
-
- //Calculate the SELECT clause
- sb.Append("SELECT ");
- int index = 0;
- foreach (LinqSQLField field in fieldList)
- {
- sb.Append("[t0].[" + field.Name + "]");
- if (index < fieldList.Count - 1) sb.Append(", ");
- index++;
- }
- sb.AppendLine();
- sb.AppendLine("FROM (");
-
- //Calculate the Inner SELECT clause
- sb.Append("SELECT ");
- index = 0;
- foreach (var field in fieldList)
- {
- sb.Append(field.GetSQL(false));
- if (index < fieldList.Count - 1) sb.Append(", ");
- index++;
- }
- sb.AppendLine();
-
- //If there is no sort then add primary key
- if (paging2.OrderByList.Count == 0)
- {
- paging2.OrderByList.Add(new OneToOneParentPagingFieldItem(OneToOneParent.FieldNameConstants.UserId));
- }
-
- //Determine the paging sort
- var isPrimary = false;
- var orderByClause = string.Empty;
- foreach (var fieldItem in paging2.OrderByList)
- {
- if (!string.IsNullOrEmpty(orderByClause)) orderByClause += ", ";
- switch (fieldItem.Field.ToString().ToLower())
- {
- case "firstname": orderByClause += "[" + (from x in fieldList where x.Alias.ToLower() == fieldItem.Field.ToString().ToLower() select x).FirstOrDefault().Table + "].[first_name]" + (fieldItem.Ascending ? string.Empty : " DESC"); break;
- case "userid": orderByClause += "[" + (from x in fieldList where x.Alias.ToLower() == fieldItem.Field.ToString().ToLower() select x).FirstOrDefault().Table + "].[user_id]" + (fieldItem.Ascending ? string.Empty : " DESC"); isPrimary = true;break;
- default: throw new Exception("The order by clause is not valid.");
- }
- }
-
- //Get the primary key for predictable sorts
- string primarySortKey = string.Empty;
- primarySortKey = "[t0].[user_id]";
-
- sb.AppendLine(", ROW_NUMBER() OVER (ORDER BY " + orderByClause + ((primarySortKey == string.Empty) || ((isPrimary && (!string.IsNullOrEmpty(primarySortKey)))) ? string.Empty : ", " + primarySortKey) + ") AS Row");
- //Calculate the FROM clause
- index = 0;
- sb.Append("FROM ");
- foreach (LinqSQLFromClause fromClause in fromLinkList)
- {
- sb.Append("[" + fromClause.Schema + "].[" + fromClause.TableName + "] AS [" + fromClause.Alias + "] ");
- if (optimizer.NoLocking) sb.Append("WITH (NOLOCK)");
- if (!string.IsNullOrEmpty(fromClause.LinkClause)) sb.Append(fromClause.LinkClause + " ");
-
- if (index < fromLinkList.Count - 1)
- {
- sb.AppendLine();
- sb.Append("LEFT OUTER JOIN ");
- }
-
- index++;
- }
- sb.AppendLine();
-
- //Calculate the WHERE clause
- if (!string.IsNullOrEmpty(whereClause))
- {
- foreach (LinqSQLFromClause fromClause in fromLinkList)
- {
- //Only process table that were original and not inserted above
- if (fromClause.AnchorAlias == string.Empty)
- {
- whereClause = LinqSQLParser.GetRemappedLinqSql(fromClause, whereClause, fromLinkList, LinqSQLParser.ObjectTypeConstants.Table);
- }
- }
- sb.Append("WHERE " + whereClause);
- }
-
- sb.AppendLine(") AS [t0]");
- sb.AppendLine("WHERE (Row >= " + (((paging2.PageIndex - 1) * paging2.RecordsperPage) + 1) + ") AND (Row <= " + (paging2.PageIndex * paging2.RecordsperPage) + ")");
-
- return sb.ToString();
- }
-
- #endregion
-
- /// <summary>
- /// Persists this collection to store.
- /// </summary>
- public override void Persist()
- {
- try
- {
- foreach (OneToOneParent item in this)
- {
- if (item.wrappedClass.RowState != DataRowState.Unchanged)
- item.OnValidate(new BusinessObjectEventArgs(item));
- }
-
- lock (wrappedClass.SubDomain)
- {
- wrappedClass.Persist();
- }
- }
- catch (System.Data.DBConcurrencyException dbcex) { throw new Widgetsphere.Core.Exceptions.ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
- catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new Widgetsphere.Core.Exceptions.UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
- catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
- }
-
- /// <summary>
- /// Select all objects from store.
- /// </summary>
- public static OneToOneParentCollection RunSelect()
- {
- return RunSelect(ConfigurationValues.GetInstance().Modifier);
- }
-
- /// <summary>
- /// Select all objects from store.
- /// </summary>
- public static OneToOneParentCollection RunSelect(string modifier)
- {
- try
- {
- var returnVal = new OneToOneParentCollection(DomainOneToOneParentCollection.RunSelect(modifier));
- return returnVal;
- }
- catch (System.Data.DBConcurrencyException dbcex) { throw new Widgetsphere.Core.Exceptions.ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
- catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new Widgetsphere.Core.Exceptions.UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
- catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
- }
-
- /// <summary>
- /// Using the specified Where expression, execute a query against the database to return a result set
- /// </summary>
- /// <param name="where">The expression that determines the records selected</param>
- public static OneToOneParentCollection RunSelect(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where)
- {
- return RunSelect(where, ConfigurationValues.GetInstance().Modifier);
- }
-
- /// <summary>
- /// Using the specified Where expression, execute a query against the database to return a result set
- /// </summary>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="modifier">The modified audit trail</param>
- public static OneToOneParentCollection RunSelect(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where, string modifier)
- {
- return RunSelect(where, new QueryOptimizer(), modifier);
- }
-
- /// <summary>
- /// Using the specified Where expression, execute a query against the database to return a result set
- /// </summary>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- /// <param name="modifier">The modified audit trail</param>
- public static OneToOneParentCollection RunSelect(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer, string modifier)
- {
- var subDomain = new SubDomain(modifier);
- var dc = new DataContext(ConfigurationValues.GetInstance().ConnectionString);
- var template = dc.GetTable<OneToOneParentQuery>();
- var cmd = BusinessCollectionPersistableBase.GetCommand<OneToOneParentQuery>(dc, template, where);
- cmd.CommandTimeout = ConfigurationValues.GetInstance().DefaultTimeOut;
- var parser = LinqSQLParser.Create(cmd.CommandText, LinqSQLParser.ObjectTypeConstants.Table);
- cmd.CommandText = parser.GetSQL(optimizer);
- dc.Connection.Open();
- var startTime = DateTime.Now;
- var result = dc.Translate<OneToOneParentQuery>(cmd.ExecuteReader());
- var endTime = DateTime.Now;
- optimizer.TotalMilliseconds = (long)endTime.Subtract(startTime).TotalMilliseconds;
- var retval = subDomain.GetCollection<OneToOneParentCollection>();
- var pkList = new HashSet<string>();
- foreach (var item in result)
- {
- var pk = item.SinglePrimaryKeyValue();
- if (!pkList.Contains(pk))
- {
- pkList.Add(pk);
- var newItem = retval.NewItem(item.UserId);
- LoadDataRow(item, newItem);
- retval.AddItem(newItem);
- }
- }
- retval.wrappedClass.AcceptChanges();
- retval.wrappedClass.EndLoadData();
- dc.Connection.Close();
- return retval;
- }
-
- /// <summary>
- /// Using the specified Where expression, execute a query against the database to return a result set
- /// </summary>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="paging">The paging object to determine how the results are paged.</param>
- public static OneToOneParentCollection RunSelect(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where, Acme.TestModel.Business.Objects.OneToOneParentPaging paging)
- {
- return RunSelect(where, paging, ConfigurationValues.GetInstance().Modifier);
- }
-
- /// <summary>
- /// Using the specified Where expression, execute a query against the database to return a result set
- /// </summary>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="paging">The paging object to determine how the results are paged.</param>
- /// <param name="modifier">The modified audit trail</param>
- public static OneToOneParentCollection RunSelect(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where, Acme.TestModel.Business.Objects.OneToOneParentPaging paging, string modifier)
- {
- return RunSelect(where, paging, new QueryOptimizer(), modifier);
- }
-
- /// <summary>
- /// Using the specified Where expression, execute a query against the database to return a result set
- /// </summary>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="paging">The paging object to determine how the results are paged.</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- /// <param name="modifier">The modified audit trail</param>
- public static OneToOneParentCollection RunSelect(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where, Acme.TestModel.Business.Objects.OneToOneParentPaging paging, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer, string modifier)
- {
- if (paging == null) throw new Exception("The paging object cannot be null.");
- var subDomain = new SubDomain(modifier);
-
- var dc = new DataContext(ConfigurationValues.GetInstance().ConnectionString);
- var template = dc.GetTable<OneToOneParentQuery>();
- var cmd = BusinessCollectionPersistableBase.GetCommand<OneToOneParentQuery>(dc, template, where);
- cmd.CommandTimeout = ConfigurationValues.GetInstance().DefaultTimeOut;
- var parser = LinqSQLParser.Create(cmd.CommandText, paging, LinqSQLParser.ObjectTypeConstants.Table);
- cmd.CommandText = parser.GetSQL(optimizer);
- dc.Connection.Open();
- var startTime = DateTime.Now;
- var result = dc.Translate<OneToOneParentQuery>(cmd.ExecuteReader());
- var endTime = DateTime.Now;
- optimizer.TotalMilliseconds = (long)endTime.Subtract(startTime).TotalMilliseconds;
- var retval = subDomain.GetCollection<OneToOneParentCollection>();
- var pkList = new HashSet<string>();
- foreach (var item in result)
- {
- var pk = item.SinglePrimaryKeyValue();
- if (!pkList.Contains(pk))
- {
- pkList.Add(pk);
- var newItem = retval.NewItem(item.UserId);
- LoadDataRow(item, newItem);
- retval.AddItem(newItem);
- }
- }
- retval.wrappedClass.AcceptChanges();
- retval.wrappedClass.EndLoadData();
- dc.Connection.Close();
- paging.RecordCount = GetCount(where);
- return retval;
- }
-
- private static void LoadDataRow(OneToOneParentQuery item, OneToOneParent newItem)
- {
- newItem.wrappedClass["user_id"] = item.UserId;
- newItem.wrappedClass["first_name"] = StringHelper.ConvertToDatabase(item.FirstName);
- }
-
- /// <summary>
- /// Get the maximum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static int? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, int>> select)
- {
- return GetMax(select, x => true);
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static int? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, int>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where)
- {
- return GetMax(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static int? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, int>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- return BusinessObjectQuery<OneToOneParent, OneToOneParentQuery, int>.GetMax(select, where, optimizer, "ONE_TO_ONE_PARENT", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the maximum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static int? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, int?>> select)
- {
- return GetMax(select, x => true);
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static int? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, int?>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where)
- {
- return GetMax(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static int? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, int?>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- return BusinessObjectQuery<OneToOneParent, OneToOneParentQuery, int?>.GetMax(select, where, optimizer, "ONE_TO_ONE_PARENT", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the maximum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static Single? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, Single>> select)
- {
- return GetMax(select, x => true);
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static Single? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, Single>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where)
- {
- return GetMax(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static Single? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, Single>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- return BusinessObjectQuery<OneToOneParent, OneToOneParentQuery, Single>.GetMax(select, where, optimizer, "ONE_TO_ONE_PARENT", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the maximum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static Single? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, Single?>> select)
- {
- return GetMax(select, x => true);
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static Single? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, Single?>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where)
- {
- return GetMax(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static Single? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, Single?>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- return BusinessObjectQuery<OneToOneParent, OneToOneParentQuery, Single?>.GetMax(select, where, optimizer, "ONE_TO_ONE_PARENT", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the maximum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static double? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, double>> select)
- {
- return GetMax(select, x => true);
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static double? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, double>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where)
- {
- return GetMax(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static double? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, double>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- return BusinessObjectQuery<OneToOneParent, OneToOneParentQuery, double>.GetMax(select, where, optimizer, "ONE_TO_ONE_PARENT", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the maximum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static double? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, double?>> select)
- {
- return GetMax(select, x => true);
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static double? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, double?>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where)
- {
- return GetMax(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static double? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, double?>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- return BusinessObjectQuery<OneToOneParent, OneToOneParentQuery, double?>.GetMax(select, where, optimizer, "ONE_TO_ONE_PARENT", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the maximum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static decimal? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, decimal>> select)
- {
- return GetMax(select, x => true);
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static decimal? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, decimal>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where)
- {
- return GetMax(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static decimal? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, decimal>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- return BusinessObjectQuery<OneToOneParent, OneToOneParentQuery, decimal>.GetMax(select, where, optimizer, "ONE_TO_ONE_PARENT", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the maximum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static decimal? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, decimal?>> select)
- {
- return GetMax(select, x => true);
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static decimal? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, decimal?>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where)
- {
- return GetMax(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static decimal? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, decimal?>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- return BusinessObjectQuery<OneToOneParent, OneToOneParentQuery, decimal?>.GetMax(select, where, optimizer, "ONE_TO_ONE_PARENT", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the maximum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static string GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, string>> select)
- {
- return GetMax(select, x => true);
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static string GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, string>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where)
- {
- return GetMax(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static string GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, string>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- return BusinessObjectQuery<OneToOneParent, OneToOneParentQuery, string>.GetMax(select, where, optimizer, "ONE_TO_ONE_PARENT", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the maximum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static DateTime? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, DateTime>> select)
- {
- return GetMax(select, x => true);
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static DateTime? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, DateTime>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where)
- {
- return GetMax(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static DateTime? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, DateTime>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- return BusinessObjectQuery<OneToOneParent, OneToOneParentQuery, DateTime>.GetMax(select, where, optimizer, "ONE_TO_ONE_PARENT", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the maximum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static DateTime? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, DateTime?>> select)
- {
- return GetMax(select, x => true);
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static DateTime? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, DateTime?>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where)
- {
- return GetMax(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the maximum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static DateTime? GetMax(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, DateTime?>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- return BusinessObjectQuery<OneToOneParent, OneToOneParentQuery, DateTime?>.GetMax(select, where, optimizer, "ONE_TO_ONE_PARENT", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the minimum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static int? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, int>> select)
- {
- return GetMin(select, x => true);
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static int? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, int>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where)
- {
- return GetMin(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static int? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, int>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- return BusinessObjectQuery<OneToOneParent, OneToOneParentQuery, int>.GetMin(select, where, optimizer, "ONE_TO_ONE_PARENT", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the minimum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static int? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, int?>> select)
- {
- return GetMin(select, x => true);
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static int? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, int?>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where)
- {
- return GetMin(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static int? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, int?>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- return BusinessObjectQuery<OneToOneParent, OneToOneParentQuery, int?>.GetMin(select, where, optimizer, "ONE_TO_ONE_PARENT", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the minimum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static Single? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, Single>> select)
- {
- return GetMin(select, x => true);
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static Single? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, Single>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where)
- {
- return GetMin(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static Single? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, Single>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- return BusinessObjectQuery<OneToOneParent, OneToOneParentQuery, Single>.GetMin(select, where, optimizer, "ONE_TO_ONE_PARENT", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the minimum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static Single? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, Single?>> select)
- {
- return GetMin(select, x => true);
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static Single? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, Single?>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where)
- {
- return GetMin(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static Single? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, Single?>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- return BusinessObjectQuery<OneToOneParent, OneToOneParentQuery, Single?>.GetMin(select, where, optimizer, "ONE_TO_ONE_PARENT", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the minimum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static double? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, double>> select)
- {
- return GetMin(select, x => true);
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static double? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, double>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where)
- {
- return GetMin(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static double? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, double>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- return BusinessObjectQuery<OneToOneParent, OneToOneParentQuery, double>.GetMin(select, where, optimizer, "ONE_TO_ONE_PARENT", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the minimum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static double? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, double?>> select)
- {
- return GetMin(select, x => true);
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static double? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, double?>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where)
- {
- return GetMin(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static double? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, double?>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- return BusinessObjectQuery<OneToOneParent, OneToOneParentQuery, double?>.GetMin(select, where, optimizer, "ONE_TO_ONE_PARENT", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the minimum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static decimal? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, decimal>> select)
- {
- return GetMin(select, x => true);
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static decimal? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, decimal>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where)
- {
- return GetMin(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static decimal? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, decimal>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- return BusinessObjectQuery<OneToOneParent, OneToOneParentQuery, decimal>.GetMin(select, where, optimizer, "ONE_TO_ONE_PARENT", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the minimum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static decimal? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, decimal?>> select)
- {
- return GetMin(select, x => true);
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static decimal? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, decimal?>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where)
- {
- return GetMin(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static decimal? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, decimal?>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- return BusinessObjectQuery<OneToOneParent, OneToOneParentQuery, decimal?>.GetMin(select, where, optimizer, "ONE_TO_ONE_PARENT", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the minimum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static string GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, string>> select)
- {
- return GetMin(select, x => true);
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static string GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, string>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where)
- {
- return GetMin(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static string GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, string>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- return BusinessObjectQuery<OneToOneParent, OneToOneParentQuery, string>.GetMin(select, where, optimizer, "ONE_TO_ONE_PARENT", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the minimum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static DateTime? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, DateTime>> select)
- {
- return GetMin(select, x => true);
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static DateTime? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, DateTime>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where)
- {
- return GetMin(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static DateTime? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, DateTime>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- return BusinessObjectQuery<OneToOneParent, OneToOneParentQuery, DateTime>.GetMin(select, where, optimizer, "ONE_TO_ONE_PARENT", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the minimum value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static DateTime? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, DateTime?>> select)
- {
- return GetMin(select, x => true);
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static DateTime? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, DateTime?>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where)
- {
- return GetMin(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the minimum value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static DateTime? GetMin(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, DateTime?>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where, Widgetsphere.Core.DataAccess.QueryOptimizer optimizer)
- {
- return BusinessObjectQuery<OneToOneParent, OneToOneParentQuery, DateTime?>.GetMin(select, where, optimizer, "ONE_TO_ONE_PARENT", GetDatabaseFieldName, LinqSQLParser.ObjectTypeConstants.Table);
- }
-
- /// <summary>
- /// Get the average value of the field for all objects
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- public static double? GetAverage(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, int>> select)
- {
- return GetAverage(select, x => true);
- }
-
- /// <summary>
- /// Get the average value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- public static double? GetAverage(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, int>> select, Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, bool>> where)
- {
- return GetAverage(select, where, new QueryOptimizer());
- }
-
- /// <summary>
- /// Get the average value of the field in the set of records that match the Where condition
- /// </summary>
- /// <param name="select">The field to aggregate</param>
- /// <param name="where">The expression that determines the records selected</param>
- /// <param name="optimizer">An object to specify querying parameters and return profiling information</param>
- public static double? GetAverage(Expression<Func<Acme.TestModel.Business.LINQ.OneToOneParentQuery, int>> select, Expression<Func