Posted on

JasonP Implementaion on MVC Controller

public ActionResult UsageJasonP()
{
db.Configuration.LazyLoadingEnabled = false;
db.Configuration.ProxyCreationEnabled = false;
var waterusages = db.WaterUsages;

//return Json(waterusages, JsonRequestBehavior.AllowGet);
return new JsonpResult(waterusages,”receive”);
}

var url = “http://localhost:15214/water/UsageJasonP?callback=?”;

$.ajax({
url: url, dataType: “jsonp”, jsonpCallback: “receive”, callback: “receive”,
success: function (data, status) {
//mySurvey.closePopup();
alert(“Success”);
console.log(data);
},
error: function (xOptions, textStatus) {
alert(“fails”);
}
});

Posted on

ASP Net Core / Docker

Yo / Asp Net Application with  Athentificaiton

Create Models Directory
Create Confernce / Session Class / MeetingDbContext class
Since there are two DbContext, notice following command for the proper context
dotnet ef migrations add Initial –context MeetingDbContext
dotnet ef database update –context MeetingDbContext
sudo apt install sqlite3
goto bin\Debug\netcoreapp1.0
sqlite3 xxxx.db
.tables  ( to find the talbes )
Ctl +d to exit from sqlite
Afer build webapp, and following is careating docker.
Make Sure docker is runnig using bellowing command:
sudo service docker status
sudo docker build -t networld/dockeraspnet
during the build case, I deleted 2 ef database update for successful building.
In case you need to delete unnecessary docker image;
docker rm -f imageid
You can get imageid using below command
docker images
To run docker image
docker run -t -p 81:5000 networld/dockeraspnet ( 81 is local port 5000 docker image running port )
To stop running docker process.
docker ps  ( to get name ), and then
docker stop name ( such as focused-joliot )
Q: How to rename docker image name once you build.
Now I create private Repo on the Docker Hub.
for example: frankfax\networld.
Build your image same as the above.
sudo docker build -t frnakfax\networld
docker login ( using hub account )
docker push frankfax/networld
docker pull frankfax/networld