Tutorial by Examples: er

In your App_start folder open routeconfig.cs and do this routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }, ...
Create a new controller foreg ControllerName: "Home", ActionresultName :"Index" open AreaRegistraion.cs and add the controller name and action name to be rerouted to context.MapRoute( "nameofarea_default", "nameofarea/{controller}/...
You can place action filters at three possible levels: Global Controller Action Placing a filter globally means it will execute on requests to any route. Placing one on a controller makes it execute on requests to any action in that controller. Placing one on an action means it runs with the...
Hibernate is an implementation of the JPA standard. As such, everything said there is also true for Hibernate. Hibernate has some extensions to JPA. Also, the way to set up a JPA provider is provider-specific. This documentation section should only contain what is specific to Hibernate.
<script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.goog...
In the following examples, json contains a JSON object with the following data: [ { "name": "John Doe", "work": { "company": { "name": "ASDF INC", "country": "USA" }, ...
By default, Jackson (the library Play JSON uses) will try to map every public field to a json field with the same name. If the object has getters/setters, it will infer the name from them. So, if you have a Book class with a private field to store the ISBN and have get/set methods named getISBN/setI...
Large scale applications often need different properties when running on different environments. we can achieve this by passing arguments to NodeJs application and using same argument in node process to load specific environment property file. Suppose we have two property files for different enviro...
Use the tar (tape archive) command to compress your files and folders. It is similar to creating .ZIP files in Windows environment. Syntax: tar -zcvf <output tar file> <source file> Example: tar -zcvf outputfile.tar.gz source file Here’s what those switches actually mean: -c: Cr...
Inbound filter is applied when item is added to the search index and allows to specify whether item is included to the index or not. Examples when inbound filter can be used - do not include standard values and previous versions of the item in the index. Inbound filters are set in configuration: ...
Outbound filter can be used to filter the search results. One of the examples of outbound filter usage is removing items which user doesn't have access to from search results. Outbound filters are set in the configuration: <indexing.filterIndex.outbound> <processor type="Sitecore....
By default Sitecore adds all versions of the item to the sitecore_master_index. The drawback of that is that if users are using workflows and adding lots of versions all of them will be added to the search results in the content editor. Configuration: <event name="item:versionAdded" &...
To open a file from local folder or temp folder, target file must not be located in those folders' root. For security reasons, to prevent other content from being exposed by WebView, the file meant for displaying must be located in a subfolder: var uri = new Uri("ms-appdata:///local/html/html-...
In the concrete class that need the service, use the interface to access the service instead of its implementation like: public class BenefitAppService { private readonly IBenefitService _service; public BenefitAppService(IBenefitService service) { _service = service; ...
By default, the full indexed document is returned as part of all searches. This is referred to as the source (_source field in the search hits). If we don’t want the entire source document returned, we have the ability to request only a few fields from within source to be returned, or we can set _so...
By default, a Docker container won't be able to run a GUI application. Before that, the X11 socket must be forwarded first to the container, so it can be used directly. The DISPLAY environment variable must be forwarded as well: docker run -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY &...
Since Node is single-threaded, there is a need of workaround if it comes to a long-running calculations. Note: this is "ready to run" example. Just, don't forget to get jQuery and install the required modules. Main logic of this example: Client sends request to the server. Server sta...
There are many fine ways to get this done, which others have already suggested. Following along the "get Excel data via SQL track", here are some pointers. Excel has the "Data Connection Wizard" which allows you to import or link from another data source or even within the very ...
[Test] public void Calculator_Add_ReturnsSumOfTwoNumbers() { Calculator calculatorUnderTest = new Calculator(); double result = calculatorUnderTest.Add(2, 3); Assert.AreEqual(5, result); }
Sometimes it is necessary to assert when an exception is thrown. Different unit testing frameworks have different conventions for asserting that an exception was thrown, (like NUnit's Assert.Throws method). This example does not use any framework specific methods, just built in exception handling. ...

Page 273 of 417