An Azure Static Web App was developed by extending the tutorial on that topic to contain 3 editable entities mimicking a database with a view to extending to use EF with an Azure SQL database. Each milestone was noted as a separate branch of the repository. This post is an idex to those branches in chronological order.


The app is for helpers to volunteer for assistance tasks at a track meet. Entity Framework Core is used with the main entities being Round, Helper and Activity. A Helper volunteers and performs an Activity at a Meet (called a Round).


Note that this page has been updated as the story is extended. Now complete. 5/5/2021

Branches of the Repository

Each is a bookmark in order of this progression.

  1. Initial-commit
  2. Completed-tutorial
    • After completing the tutorial
  3. Rename-Products-to-Activitys
    • Renamed the Products entity as Activitys. Functionality etc. Unchanged otherwise.
  4. Activitys-helpers-rounds-Basic
    • Added Helpers and Round entities as properties to Activitys. Can list Activitys and get Helpers and Rounds on client from that.
  5. Add-helper_and-round-apis
    • Implemented Helper and Round APIs and app pages
  6. Tried-Chrissainty-localstorage
    • This was a dead-end as it uses Javascript which made no sense on the server.
  7. Entities-as-a-csharp-local-storage-service
  8. Can-reset-data

  9. Attempt to add EF and Migration_and SQLSvr
    • First, worked through blog post Using Entity Framework with Azure Functions, creating the project separate to this project.
    • Then tried to apply same to the Api project here.
    • But could not run add-migration. Got error message:
Error:
  An assembly specified in the application dependencies manifest (Api.deps.json) was not found:
    package: 'Api', version: '1.0.0'
    path: 'Api.dll'

9(con)
- Have queried about this on Stackoverflow here: Azure Function PostBuild File Copy being lost - Whereas the build for the Using Entity Framework with Azure Functions project copies that and other files to $(Target) folder from $(Target)bin this Api project does not. - Will now abandon this approach and directly use the Azure Function project from Using Entity Framework with Azure Functions. - Nb: This has now been resolved. The Main Branch now has this working

“Nearly” The Final Solution:

Link: 10. EF and can recreate data

  • EF Works :)
    • Except: Cascade Delete not working here. See main branch.
  • This all now works with an Azure SQL Database, and CRUD actions in the API project as Azure C# functions.
  • Can do new Migrations and database updates from within Visual Studio in the PMC terminal.
  • Solution was a recreation of 8. with some tweaks.
  • I am guessing, but I think moving from EF Core Version 2.3.3 packages to 3.3.14 might have solved the problem in 9. above.
  • Another issue arose, in that with CRUD, GET,DELETE and PUt worked but POST only worked for the entities with scalar properties. The new Activity POST which has Helper and Round entity properties would not work except for when a complete entity with all new properties was Json POST using Curl.

Next: Cascade and SetNull Deletions See link below.


Posts in this series: An Azure Static Web App with EF

  1. Multiple Entities and LocalStorage
  2. Index of the Repository This post.
  3. Entity Framework Core Implementation
  4. Cascade and SetNull Deletions

 TopicSubtopic
   
 This Category Links 
Category:Web Sites Index:Web Sites
  Next: > An Azure Static Web App with EF
<  Prev:   An Azure Static Web App with EF