This commit is contained in:
28
notes/deploy.txt
Normal file
28
notes/deploy.txt
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
***********************
|
||||
HOW TO DEPLOY TO IIS
|
||||
https://stackify.com/how-to-deploy-asp-net-core-to-iis/
|
||||
|
||||
1) SET VERSION
|
||||
|
||||
SET app.api RFVERSION property
|
||||
RENAME ?RFV5.1 parameter in default.htm to the new version so all files update on mobile
|
||||
|
||||
|
||||
2) PUBLISH
|
||||
publish command line from rockfishCore folder:
|
||||
|
||||
//this will build a release version which is what we use on the server now
|
||||
dotnet publish -c Release -o ./../rfcpublish/
|
||||
|
||||
dotnet publish -f netcoreapp2.1 -c Release -o ./../rfcpublish/
|
||||
|
||||
//if need a debug version
|
||||
dotnet publish -o ./../rfcpublish/
|
||||
|
||||
3) COPY
|
||||
Copy over to production server, only need the .dll and the wwwroot folder contents,
|
||||
remember not to delete the folders on the server only replace their contents because there are Windows file permissions set
|
||||
Backup the database
|
||||
|
||||
4) Delete any test data local here
|
||||
114
notes/notes.txt
Normal file
114
notes/notes.txt
Normal file
@@ -0,0 +1,114 @@
|
||||
|
||||
|
||||
b43698c255365ee739c05ba0d42855e96c2365c76bb2f9b9eb149cec7b52174c
|
||||
*********************************************
|
||||
Updating Microsoft CODE editor
|
||||
Download the .deb file for 64 bit
|
||||
execute it
|
||||
sudo dpkg -i code_1.8.1-1482159060_i386.deb
|
||||
** UPDATE: As of October 2017 it now updates when you update Debian apt-get update etc
|
||||
|
||||
|
||||
|
||||
HANDLEBARS
|
||||
=-=-=-=-=-
|
||||
Install:
|
||||
sudo npm install -g handlebars
|
||||
|
||||
Build handlebars template:
|
||||
handlebars -m wwwroot/js/templates/> wwwroot/js/templates/templates.js
|
||||
|
||||
|
||||
|
||||
|
||||
3rd party Packages used:
|
||||
JWT JSON web token support using jose-jwt found here:
|
||||
https://jwt.io/#libraries
|
||||
|
||||
Mailkit (supposedly system.net.mail will be ported in v2.0 of .net core but for now mailkit is the shit):
|
||||
<!-- NOTE: bouncycastle needed for license gen but mailkit brings a slightly different one in so there is a conflict but just removing bouncycastle works because the license code uses teh mailkit bouncycastle-->
|
||||
<!--PackageReference Include="bouncycastle.netcore" Version="1.8.1.3" /-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
**************************
|
||||
//command to scaffold the sqlite db:
|
||||
dotnet ef dbcontext scaffold "Datasource=/home/john/Documents/rockfishCore/db/rockfish.sqlite" Microsoft.EntityFrameworkCore.Sqlite -o Models -f
|
||||
|
||||
//scaffold all controllers with these commands:
|
||||
dotnet aspnet-codegenerator controller -api -m rockfishCore.Models.Contact -dc rockfishCore.Models.rockfishContext -name ContactController -outDir ./Controllers
|
||||
dotnet aspnet-codegenerator controller -api -m rockfishCore.Models.Customer -dc rockfishCore.Models.rockfishContext -name CustomerController -outDir ./Controllers
|
||||
dotnet aspnet-codegenerator controller -api -m rockfishCore.Models.Incident -dc rockfishCore.Models.rockfishContext -name IncidentController -outDir ./Controllers
|
||||
dotnet aspnet-codegenerator controller -api -m rockfishCore.Models.LicenseTemplates -dc rockfishCore.Models.rockfishContext -name LicenseTemplatesController -outDir ./Controllers
|
||||
dotnet aspnet-codegenerator controller -api -m rockfishCore.Models.Notification -dc rockfishCore.Models.rockfishContext -name NotificationController -outDir ./Controllers
|
||||
dotnet aspnet-codegenerator controller -api -m rockfishCore.Models.Purchase -dc rockfishCore.Models.rockfishContext -name PurchaseController -outDir ./Controllers
|
||||
dotnet aspnet-codegenerator controller -api -m rockfishCore.Models.Site -dc rockfishCore.Models.rockfishContext -name SiteController -outDir ./Controllers
|
||||
dotnet aspnet-codegenerator controller -api -m rockfishCore.Models.Trial -dc rockfishCore.Models.rockfishContext -name TrialController -outDir ./Controllers
|
||||
dotnet aspnet-codegenerator controller -api -m rockfishCore.Models.User -dc rockfishCore.Models.rockfishContext -name UserController -outDir ./Controllers
|
||||
|
||||
|
||||
Here is the help command for this:
|
||||
dotnet aspnet-codegenerator controller --help
|
||||
|
||||
|
||||
|
||||
***********************************
|
||||
EF CORE STUFF NOTES
|
||||
|
||||
To INCLUDE relatives use like this:
|
||||
|
||||
var site = await _context.Site
|
||||
.Include(m=>m.TrialNavigation)
|
||||
.Include(m=>m.Purchase)
|
||||
.Include(m=>m.Incident)
|
||||
.SingleOrDefaultAsync(m => m.Id == id);
|
||||
|
||||
|
||||
|
||||
=-=-=-=-
|
||||
EF Core include queries
|
||||
|
||||
|
||||
//ad-hoc:
|
||||
// var res = from c in _context.Customer.OrderBy(c => c.Name)
|
||||
// join site in _context.Site.DefaultIfEmpty() on c.Id equals site.CustomerId
|
||||
// join purchase in _context.Purchase.DefaultIfEmpty() on site.Id equals purchase.SiteId
|
||||
// where (purchase.CancelDate == null)
|
||||
// select new infoListCustomer
|
||||
// {
|
||||
// active = c.Active,
|
||||
// id = c.Id,
|
||||
// name = c.Name,
|
||||
// siteId = site.Id,
|
||||
// siteName = site.Name,
|
||||
// purchaseId = purchase.Id,
|
||||
// purchaseName = purchase.Name
|
||||
// };
|
||||
|
||||
|
||||
//Using ef relationships:
|
||||
|
||||
// using (var context = new BloggingContext())
|
||||
// {
|
||||
// var blogs = context.Blogs
|
||||
// .Include(blog => blog.Posts)
|
||||
// .ThenInclude(post => post.Author)
|
||||
// .ThenInclude(author => author.Photo)
|
||||
// .Include(blog => blog.Owner)
|
||||
// .ThenInclude(owner => owner.Photo)
|
||||
// .ToList();
|
||||
// }
|
||||
|
||||
var res = _context.Customer
|
||||
.Include(customer => customer.Site)
|
||||
.ThenInclude(site => site.Purchase)//or...:
|
||||
//.Include(customer => customer.Purchase)//this also due to reference in EF
|
||||
.OrderBy(customer => customer.Name);
|
||||
//.ToList();
|
||||
|
||||
|
||||
var xtest=res.ToList();
|
||||
var xcount=xtest.Count();
|
||||
0
notes/todo
Normal file
0
notes/todo
Normal file
Reference in New Issue
Block a user