readme.txt 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. Upd: 2.8.2021
  2. To reverse update:
  3. - Set Data project as Startup Project
  4. - Ensure if solution is buildable - backup Entity folder
  5. - Open PM (Package Manager Console from View menu)
  6. - Run following command (in case localdb use (localdb)\\MSSQLLocalDB)
  7. Scaffold-DbContext "Server=use (localdb)\\MSSQLLocalDB;Database=BO;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Entity -Force
  8. - Go to file BOContext.cs and replace class declaration as : public partial class BOContext : DataDomain
  9. - Delete constructor BoContext()
  10. - replace in all entities // public long Id { get; set; } -> // // public long Id { get; set; }
  11. - replace in BOContext.cs occurency [ln cca:173]:
  12. entity.HasOne(d => d.Workspace)
  13. .WithMany(p => p.BillingInfos)
  14. .HasForeignKey(d => d.WorkspaceId)
  15. .OnDelete(DeleteBehavior.ClientSetNull)
  16. .HasConstraintName("REL_BillingInfo_Workspace");
  17. to:
  18. //entity.HasOne(d => d.Workspace)
  19. // .WithMany(p => p.BillingInfos)
  20. // .HasForeignKey(d => d.WorkspaceId)
  21. // .OnDelete(DeleteBehavior.ClientSetNull)
  22. // .HasConstraintName("REL_BillingInfo_Workspace");
  23. - replace in BOContext.cs occurency [ln cca:1069]:
  24. modelBuilder.Entity<UserWorkspace>(entity =>
  25. {
  26. entity.HasNoKey();
  27. to:
  28. modelBuilder.Entity<UserWorkspace>(entity =>
  29. {
  30. // entity.HasNoKey();
  31. - replace in BOContext.cs occurency [ln cca:1139]:
  32. entity.HasOne(d => d.BillingInfo)
  33. .WithMany(p => p.Workspaces)
  34. .HasForeignKey(d => d.BillingInfoId)
  35. .HasConstraintName("REL_Workspace_BillingInfo");
  36. to:
  37. //entity.HasOne(d => d.BillingInfo)
  38. // .WithMany(p => p.Workspaces)
  39. // .HasForeignKey(d => d.BillingInfoId)
  40. // .HasConstraintName("REL_Workspace_BillingInfo");