Assuming I want to keep track of LastVisited field in a DB and I want to update it on each incoming request whether its hitting a ServiceStack API or an MVC Controller. What would be the best way of handling it? Obviously I can put the logic in the Global asax which will run on each request, but how would I access the session object from ServiceStack? or is there a an http handler I can attach to where the ServiceStack's session is available.
Updating database on each http request with ServiceStack
157 Views Asked by Val At
1
There are 1 best solutions below
Related Questions in ASP.NET-MVC
- Can MVC.NET prevent SQL-injection at razor or controller level?
- Getting and passing MVC Model data to AngularJS controller
- Access property of an object of type [Model] in JQuery
- Entity Framework Code First with Fluent API Concurrency `DbUpdateConcurrencyException` Not Raising
- Bundling and minification issue in MVC
- ASP-MVC Code-first migrations checkbox not active
- Why does Azure CloudConfigurationManager.GetSetting return null
- Dynamic roles list in CustomAuthorize ASP MVC
- Jquery: Change contents of <select> tag dynamically
- Why web API return 404 when deploy to IIS
- MVC route URL not containing parameter
- Invalidate user credentials when password changes
- MVC : Insert data to two tables
- MVC - Only allow users to edit their own data
- Submit Button on Razor View doesn't call Action Result - MVC
Related Questions in SESSION
- Access property of an object of type [Model] in JQuery
- __PHP_Incomplete_Class Object even though class is included before session started
- Safari Extension not geting session Info
- Laravel: Locale Session: Controller gets Parameter to change it but it cant. U have to hardcode it
- Does OPEN SYMMETRIC KEY (SQL Server) remain in scope on a server farm?
- Superagent share session / cookie info with actual browser
- Session Destroyed on page refresh
- MVC Referencing strongly typed session objects on my view
- What is the best way to persist a global array in php?
- Error in indicies while unsetting Sessions
- Server side PHP session is not working in android
- Laravel - session data survives log-out/log-in, even for different users
- The page isn't redirecting properly when I logout
- Session array unset and delete row
- Validating a login using PHP
Related Questions in ASP.NET-MVC-4
- Jquery: Change contents of <select> tag dynamically
- redirect to actionResult method from an api
- Open another view through controller from jQuery?
- ASP MVC 5 Html.EditorFor not working / Unable to access/use Default Editor Templates
- Having error in updating my record in database my method as follows
- Is it possible to access an additional custom model property from viewdata.modelmetadata.properties?
- Which plugin is used to show the data in front end of socrata
- Set focus on button that triggered page reload
- jQuery: How to traverse / Iterate over a list of object
- Switching CSS Just for that view?
- Protractor, login to asp,net MVC login page, wait for default page then , redirect to angular page and do tests....how?
- Ajax.beginForm() cannot get post value
- Get desired html element's attribute value and set to hidden field before binding in Asp.Net MVC
- Get Value From Dynamically Populated Hidden Field
- Asp.net MVC Routelink null controller parameter
Related Questions in SERVICESTACK
- ServiceStack versioning - how to customize the request deserialization based on versioning
- ServiceStack selfhosting disable caching for memory
- Servicestack reverse routing exception
- AutoQuery with a view
- What happened to SafeConvertAll in ServiceStack?
- ServiceStack Self Hosting Redirect any 404 for SPA (Url Rewrite)
- ServiceStack View 403 (Forbidden)
- Soap Address Location : ServiceStack SOAP 1.2
- LINQ query fails with nullable variable ormlite
- Consuming Servicestack SOAP Service
- Override field name de-serialization in ServiceStack
- ServiceStack Serialization and De-serialization
- Auto-Generating Client Code - OpenRasta, Nancy and ServiceStack
- ServiceStack Authenticates both iOS Apps when one is logged in
- ServiceStack MemoryCached Authentication Register User
Related Questions in HTTPLISTENERREQUEST
- What's the equivalent of HttpContext.Current.User in an HttpListener-hosted service?
- Web server HttpListener response
- Read file in C# sent with Requests Python
- Updating database on each http request with ServiceStack
- How to be sure a http request is local when using HttpListener
- HttpListener - how do I send a WebException HTTP 304 "Not Modified" error back to browser?
- What validation does HTTPListenerRequest.GetClientCertificate have before it gets the certificate?
- completion port thread is leaking when client terminates the connection
- How to handle Url encoding in HttpListenerRequest?
- Getting form data from HttpListenerRequest
- HttpListenerRequest.GetClientCertificate() not returning the complete certificate chain
- IsWebSocketRequests not working in mono
- C# HttpListener: storing posted file is always 2 byte larger than original
- How can I get form parameters from HttpListenerRequest?
- Httplistener and file upload
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
and
These will override methods that are part of the
System.Web.Mvc.Controllerclass.We override this class with a base controller which all our controllers inherit from. You could use either of these for what you are asking.