//------------------------------------------------------------------------------ // // This code was generated from a template. // // Manual changes to this file may cause unexpected behavior in your application. // Manual changes to this file will be overwritten if the code is regenerated. // //------------------------------------------------------------------------------ namespace Neo.Afx.Admin.Audit { using System; using System.Data.Entity; using System.Data.Entity.Infrastructure; using System.Data.Entity.Core.Objects; using System.Linq; public partial class AfxAdminAuditContext : DbContext { public AfxAdminAuditContext() : base("name=AfxAdminAuditContext") { this.Configuration.LazyLoadingEnabled = false; } protected override void OnModelCreating(DbModelBuilder modelBuilder) { throw new UnintentionalCodeFirstException(); } public virtual DbSet Actions { get; set; } public virtual DbSet Histories { get; set; } public virtual DbSet Sources { get; set; } public virtual DbSet SystemLogs { get; set; } public virtual DbSet Users { get; set; } public virtual ObjectResult Pr_AuditHistorySearch(Nullable sourceID, Nullable actionID, Nullable entityID, Nullable itemID, Nullable isCritical, Nullable isException, Nullable createdByID, Nullable startDate, Nullable endDate) { var sourceIDParameter = sourceID.HasValue ? new ObjectParameter("SourceID", sourceID) : new ObjectParameter("SourceID", typeof(short)); var actionIDParameter = actionID.HasValue ? new ObjectParameter("ActionID", actionID) : new ObjectParameter("ActionID", typeof(short)); var entityIDParameter = entityID.HasValue ? new ObjectParameter("EntityID", entityID) : new ObjectParameter("EntityID", typeof(int)); var itemIDParameter = itemID.HasValue ? new ObjectParameter("ItemID", itemID) : new ObjectParameter("ItemID", typeof(long)); var isCriticalParameter = isCritical.HasValue ? new ObjectParameter("IsCritical", isCritical) : new ObjectParameter("IsCritical", typeof(bool)); var isExceptionParameter = isException.HasValue ? new ObjectParameter("IsException", isException) : new ObjectParameter("IsException", typeof(bool)); var createdByIDParameter = createdByID.HasValue ? new ObjectParameter("CreatedByID", createdByID) : new ObjectParameter("CreatedByID", typeof(long)); var startDateParameter = startDate.HasValue ? new ObjectParameter("StartDate", startDate) : new ObjectParameter("StartDate", typeof(System.DateTime)); var endDateParameter = endDate.HasValue ? new ObjectParameter("EndDate", endDate) : new ObjectParameter("EndDate", typeof(System.DateTime)); return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("Pr_AuditHistorySearch", sourceIDParameter, actionIDParameter, entityIDParameter, itemIDParameter, isCriticalParameter, isExceptionParameter, createdByIDParameter, startDateParameter, endDateParameter); } public virtual ObjectResult Pr_AuditSystemLogSearch(string tableName, Nullable tableKey, string tableOperation, Nullable createdByID, Nullable startDate, Nullable endDate) { var tableNameParameter = tableName != null ? new ObjectParameter("TableName", tableName) : new ObjectParameter("TableName", typeof(string)); var tableKeyParameter = tableKey.HasValue ? new ObjectParameter("TableKey", tableKey) : new ObjectParameter("TableKey", typeof(long)); var tableOperationParameter = tableOperation != null ? new ObjectParameter("TableOperation", tableOperation) : new ObjectParameter("TableOperation", typeof(string)); var createdByIDParameter = createdByID.HasValue ? new ObjectParameter("CreatedByID", createdByID) : new ObjectParameter("CreatedByID", typeof(long)); var startDateParameter = startDate.HasValue ? new ObjectParameter("StartDate", startDate) : new ObjectParameter("StartDate", typeof(System.DateTime)); var endDateParameter = endDate.HasValue ? new ObjectParameter("EndDate", endDate) : new ObjectParameter("EndDate", typeof(System.DateTime)); return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("Pr_AuditSystemLogSearch", tableNameParameter, tableKeyParameter, tableOperationParameter, createdByIDParameter, startDateParameter, endDateParameter); } } }