Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public string GetFriendlyUrlString(string originalUrl)
- {
- var friendly = _cacheManager.Get(originalUrl.ToLower(), () =>
- (from f in _friendlyUrlRepository.ReadOnlyTable <--------- LINE 48
- where f.OriginalUrl == originalUrl
- select f.Url).ToList().SingleOrDefault());
- return friendly ?? originalUrl;
- }
- System.InvalidOperationException
- Unexpected connection state. When using a wrapping provider ensure that the StateChange event is implemented on the wrapped DbConnection.
- System.InvalidOperationException: Unexpected connection state. When using a wrapping provider ensure that the StateChange event is implemented on the wrapped DbConnection.
- at System.Data.Entity.Core.Objects.ObjectContext.EnsureContextIsEnlistedInCurrentTransaction[T](Transaction currentTransaction, Func`1 openConnection, T defaultValue)
- at System.Data.Entity.Core.Objects.ObjectContext.EnsureConnection(Boolean shouldMonitorTransactions)
- at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
- at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__5()
- at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
- at System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
- at System.Data.Entity.Core.Objects.ObjectQuery`1.<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__0()
- at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()
- at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
- at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
- at Nop.Services.Seo.FriendlyUrlService.<>c__DisplayClass5.<GetFriendlyUrlString>b__4() in ...\Libraries\Nop.Services\Seo\FriendlyUrlService.cs:line 48
- System.InvalidOperationException
- ExecuteReader requires an open and available Connection. The connection's current state is closed.
- System.Data.Entity.Core.EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details. ---> System.InvalidOperationException: ExecuteReader requires an open and available Connection. The connection's current state is closed.
- at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async)
- at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
- at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
- at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
- at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
- at Glimpse.Ado.AlternateType.GlimpseDbCommand.ExecuteDbDataReader(CommandBehavior behavior)
- at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
- at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader(DbCommand command, DbCommandInterceptionContext interceptionContext)
- at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
- --- End of inner exception stack trace ---
- at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
- at System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context, ObjectParameterCollection parameterValues)
- at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
- at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__5()
- at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
- at System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
- at System.Data.Entity.Core.Objects.ObjectQuery`1.<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__0()
- at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()
- at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
- at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
- at Nop.Services.Seo.FriendlyUrlService.<>c__DisplayClass5.<GetFriendlyUrlString>b__4() in ...\Libraries\Nop.Services\Seo\FriendlyUrlService.cs:line 48
- System.ObjectDisposedException: The ObjectContext instance has been disposed and can no longer be used for operations that require a connection.
- at System.Data.Entity.Core.Objects.ObjectContext.ReleaseConnection()
- at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
- at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__5()
- at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
- at System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
- at System.Data.Entity.Core.Objects.ObjectQuery`1.<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__0()
- at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()
- at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
- at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
- at Nop.Services.Seo.FriendlyUrlService.<>c__DisplayClass5.<GetFriendlyUrlString>b__4() in ...\Libraries\Nop.Services\Seo\FriendlyUrlService.cs:line 48
- System.NullReferenceException: Object reference not set to an instance of an object.
- at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
- at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
- at System.Data.SqlClient.SqlConnection.Open()
- at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext](TTarget target, Action`2 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
- at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open(DbConnection connection, DbInterceptionContext interceptionContext)
- at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.<>c__DisplayClass1.<Execute>b__0()
- at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
- at System.Data.Entity.Core.EntityClient.EntityConnection.Open()
- at System.Data.Entity.Core.Objects.ObjectContext.EnsureConnection(Boolean shouldMonitorTransactions)
- at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
- at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__5()
- at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
- at System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
- at System.Data.Entity.Core.Objects.ObjectQuery`1.<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__0()
- at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()
- at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
- at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
- at Nop.Services.Seo.FriendlyUrlService.<>c__DisplayClass5.<GetFriendlyUrlString>b__4() in ...\Libraries\Nop.Services\Seo\FriendlyUrlService.cs:line 48
- System.ArgumentException
- An item with the same key has already been added.
- System.ArgumentException: An item with the same key has already been added.
- at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
- at System.Data.Entity.Internal.InternalContext.Set[TEntity]()
- at System.Data.Entity.DbContext.Set[TEntity]()
- at Nop.Data.NopObjectContext.Set[TEntity]() in ...\Libraries\Nop.Data\NopObjectContext.cs:line 106
- at Nop.Data.EfRepository`1.get_Entities() in ...\Libraries\Nop.Data\EfRepository.cs:line 136
- at Nop.Data.EfRepository`1.get_ReadOnlyTable() in ...\Libraries\Nop.Data\EfRepository.cs:line 120
- at Nop.Services.Seo.FriendlyUrlService.<>c__DisplayClass5.<GetFriendlyUrlString>b__4() in ...\Libraries\Nop.Services\Seo\FriendlyUrlService.cs:line 48
- at Nop.Core.Caching.CacheExtensions.Get[T](ICacheManager cacheManager, String key, Int32 cacheTime, Func`1 acquire) in ...\Libraries\Nop.Core\Caching\Extensions.cs:line 22
- at Nop.Services.Seo.FriendlyUrlService.GetFriendlyUrlString(String originalUrl) in ...\Libraries\Nop.Services\Seo\FriendlyUrlService.cs:line 52
- at Site.Infrastructure.CatalogRoute.GetRouteData(HttpContextBase httpContext) in ...\Infrastructure\CatalogRoute.cs:line 46
- at Castle.Proxies.Invocations.Route_GetRouteData_1.InvokeMethodOnTarget()
- at Castle.DynamicProxy.AbstractInvocation.Proceed()
- at Glimpse.Core.Extensibility.AlternateMethod.NewImplementation(IAlternateMethodContext context)
- at Castle.DynamicProxy.AbstractInvocation.Proceed()
- at Castle.Proxies.RouteProxy_1.GetRouteData(HttpContextBase httpContext)
- at System.Web.Routing.RouteCollection.GetRouteData(HttpContextBase httpContext)
- at System.Web.Routing.UrlRoutingModule.PostResolveRequestCache(HttpContextBase context)
- at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
- at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Advertisement
Add Comment
Please, Sign In to add comment