protected override void OnSessionClose(object ctx, CodeFluent.Runtime.BinaryServices.Session session) { if (ctx == null) { throw new System.ArgumentNullException("ctx"); } if (session == null) { throw new System.ArgumentNullException("session"); } if (!OnSessionChange(session, CodeFluent.Runtime.BinaryServices.SessionChangeType.Closing, ctx, true, null)) { return; } System.Net.HttpListenerContext context = (System.Net.HttpListenerContext)ctx; string entityTypeName; string propertyName; string entityKey; ParseUri(context.Request.Url, out entityTypeName, out propertyName, out entityKey); OnSessionClose(context, session, entityTypeName, propertyName, entityKey); OnSessionChange(session, CodeFluent.Runtime.BinaryServices.SessionChangeType.Closed, ctx, false, null); }
protected virtual void OnSessionClose(System.Net.HttpListenerContext context, CodeFluent.Runtime.BinaryServices.Session session, string entityTypeName, string propertyName, string entityKey) { throw new System.InvalidOperationException(SoftFluent.Samples.AzureCache.Resources.Manager.GetStringWithDefault("bitsServerInvalidUrl", "Invalid url '{0}'.", new object[] { context.Request.Url })); }
protected virtual void OnSessionClose(System.Net.HttpListenerContext context, CodeFluent.Runtime.BinaryServices.Session session, string entityTypeName, string propertyName, string entityKey) { if (entityTypeName == "ContactManager.User") { if (propertyName == "Photo") { ContactManager.User entity = ContactManager.User.LoadByEntityKey(entityKey); if (entity != null) { CloseSession(context, entity.Photo, session); return; } } } throw new System.InvalidOperationException(ContactManager.Resources.Manager.GetStringWithDefault("bitsServerInvalidUrl", "Invalid url '{0}'.", new object[] { context.Request.Url })); }