Posts

Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:3.1 or one of its dependencies could not be resolved.

Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:3.1 or one of its dependencies could not be resolved . First of all, check the maven repositiory server is up. 1. Check Proxy is set up and working First I thought it was a proxy problem, I made sure that maven settings.xml contained the proxy settings (settings.xml can exist in two places one in MAVEN_HOME. The other in %userprofile%.m2\ with the later having higher precedence): <proxy>   <id> optional </id>   <active> true </active>     <protocol> http </protocol>   <username> optional-proxyuser </username>   <password> optional-proxypass </password>   <host> proxy.host.net </host>   <port> 80 </port>   <nonProxyHosts> local.net|some.host.com </nonProxyHosts> </proxy> and checked that the proxy is working by trying...

ASP.Net MVC Core: Javascript files in Areas along with Views (.cschtml)

Areas in MVC allow you to separate your web application into segments, each with their own set of Controllers and Views, for better organization and intuitive access via routing.   Here I want to manage my static java script files particular objects in areas i.e. I want to place my CountryDetail.js and CountryGrid.js files in Areas/Setup/Country Folder along with CountryDetail.cshtml and CountryGrid.cshtml. As you know, in .Net Core, as part of the OWIN pipeline , no static files are rendered by default including those in the "wwwroot" folder. Where things used to be handled in web.config, now everything goes through the OWIN pipeline. You have to add the StaticFile Middleware which will allow those to be rendered. The default implementation allows all files under "wwwroot" to be rendered. public void Configure ( IApplicationBuilder app) {     app. UseStaticFiles (); } Here is the official Microsoft documentation:  Working with StaticFiles...

ASP.Net Core: Post JSON data to Api Controller

To post JSON data to web api controller in MVC Core is little bit change. public class StudentController : Controller { [ HttpPost ] public IActionResult AddStudent ( Student student ) { return Ok() ; } } public class Student { public string FirstName { get ; set ; } public string LastName { get ; set ; } public int Age { get ; set ; } } Here we have a model student and a Post Method in StudentController i.e. AddStudent.  So where does the  Student   parameter come from? Model binding to the rescue! There are a number of different places the model binders can look for data in order to hydrate the person object. The model binders are highly extensible, and allow custom implementations, but common bindings include: Route values - navigating to a route such as  {controller}/{action}/{id}  will allow binding to an  id parameter Querystrings - If you have passed variables as q...