This commit is contained in:
2020-06-08 18:13:07 +00:00
parent 6f8eb9ba6b
commit aae0156430
2 changed files with 15 additions and 15 deletions

View File

@@ -69,19 +69,19 @@ namespace AyaNova.Api.Controllers
/// <summary> // /// <summary>
/// Get Trial status of license // /// Get Trial status of license
/// </summary> // /// </summary>
/// <returns>True if a trial license</returns> // /// <returns>True if a trial license</returns>
[AllowAnonymous] // [AllowAnonymous]
[HttpGet("trial")] // [HttpGet("trial")]
public ActionResult GetTrialFlag() // public ActionResult GetTrialFlag()
{ // {
//note: this route is called by the client as the first action so it also acts like a ping to see if the server is up as well // //note: this route is called by the client as the first action so it also acts like a ping to see if the server is up as well
if (serverState.IsClosed) // if (serverState.IsClosed)
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason)); // return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
return Ok(ApiOkResponse.Response(AyaNova.Core.License.ActiveKey.TrialLicense)); // return Ok(ApiOkResponse.Response(AyaNova.Core.License.ActiveKey.TrialLicense));
} // }

View File

@@ -480,7 +480,7 @@ namespace AyaNova.Core
if (ldb == null) if (ldb == null)
{ {
ldb = new Models.License(); ldb = new Models.License();
ldb.DbId = Guid.NewGuid(); ldb.DbId = Guid.NewGuid();//<--Permanent and unchanging DB ID for this database, the license must match this
ldb.Key = "none"; ldb.Key = "none";
ct.License.Add(ldb); ct.License.Add(ldb);
await ct.SaveChangesAsync(); await ct.SaveChangesAsync();
@@ -489,7 +489,7 @@ namespace AyaNova.Core
//ensure DB ID //ensure DB ID
if (ldb.DbId == Guid.Empty) if (ldb.DbId == Guid.Empty)
{ {
ldb.DbId = Guid.NewGuid(); ldb.DbId = Guid.NewGuid();//<--Permanent and unchanging DB ID for this database, the license must match this
//Convert the no tracking record fetched above to tracking //Convert the no tracking record fetched above to tracking
//this is required because a prior call to initialize before dumping the db would mean the license is still in memory in the context //this is required because a prior call to initialize before dumping the db would mean the license is still in memory in the context
ct.Entry(ldb).State = Microsoft.EntityFrameworkCore.EntityState.Modified; ct.Entry(ldb).State = Microsoft.EntityFrameworkCore.EntityState.Modified;