From c261130611b2940e555b0639856b80c60e3c0f10 Mon Sep 17 00:00:00 2001 From: Lance McCarthy Date: Wed, 8 May 2024 08:20:22 -0400 Subject: [PATCH 1/6] Upgrade SDK from netcore2.1 to net8.0 --- signalr-hubs/signalr-for-aspnet-core.sln | 4 ++-- .../signalr-for-aspnet-core.csproj | 13 ++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/signalr-hubs/signalr-for-aspnet-core.sln b/signalr-hubs/signalr-for-aspnet-core.sln index 2484f43..9ef5d12 100644 --- a/signalr-hubs/signalr-for-aspnet-core.sln +++ b/signalr-hubs/signalr-for-aspnet-core.sln @@ -1,9 +1,9 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.27428.2037 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "signalr-for-aspnet-core", "signalr-for-aspnet-core\signalr-for-aspnet-core.csproj", "{C10DB25F-9FF8-4136-A05D-1869947045AF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "signalr-for-aspnet-core", "signalr-for-aspnet-core\signalr-for-aspnet-core.csproj", "{C10DB25F-9FF8-4136-A05D-1869947045AF}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/signalr-hubs/signalr-for-aspnet-core/signalr-for-aspnet-core.csproj b/signalr-hubs/signalr-for-aspnet-core/signalr-for-aspnet-core.csproj index 28dfb56..211ea38 100644 --- a/signalr-hubs/signalr-for-aspnet-core/signalr-for-aspnet-core.csproj +++ b/signalr-hubs/signalr-for-aspnet-core/signalr-for-aspnet-core.csproj @@ -1,12 +1,11 @@  - - netcoreapp2.1 + net8.0 + InProcess - - - + + + - - + \ No newline at end of file From a223d992cf6013b3a1b793b624d20f31461fbcad Mon Sep 17 00:00:00 2001 From: Lance McCarthy Date: Wed, 8 May 2024 08:26:46 -0400 Subject: [PATCH 2/6] Replace deprecated code with modern equivalent and general housekeeping --- .../Hubs/ProductHub.cs | 111 +- .../Models/CategorySignalR.cs | 14 +- .../Models/ProductSignalR.cs | 22 +- .../Models/SampleEntities.cs | 1225 ++++++++--------- .../Models/SamplesEntities/Category.cs | 25 +- .../Models/SamplesEntities/Customer.cs | 39 +- .../SamplesEntities/CustomerCustomerDemo.cs | 17 +- .../SamplesEntities/CustomerDemographic.cs | 17 +- .../Models/SamplesEntities/Employee.cs | 55 +- .../SamplesEntities/EmployeeDirectory.cs | 37 +- .../SamplesEntities/EmployeeTerritory.cs | 17 +- .../Models/SamplesEntities/GanttDependency.cs | 17 +- .../Models/SamplesEntities/GanttResource.cs | 15 +- .../GanttResourceAssignment.cs | 17 +- .../Models/SamplesEntities/GanttTask.cs | 31 +- .../Models/SamplesEntities/Intraday.cs | 25 +- .../Models/SamplesEntities/Meeting.cs | 41 +- .../Models/SamplesEntities/MeetingAttendee.cs | 15 +- .../Models/SamplesEntities/Order.cs | 47 +- .../Models/SamplesEntities/OrderDetail.cs | 23 +- .../SamplesEntities/OrgChartConnection.cs | 25 +- .../Models/SamplesEntities/OrgChartShape.cs | 15 +- .../Models/SamplesEntities/Product.cs | 41 +- .../Models/SamplesEntities/Region.cs | 17 +- .../Models/SamplesEntities/Shipper.cs | 19 +- .../Models/SamplesEntities/Stock.cs | 25 +- .../Models/SamplesEntities/Supplier.cs | 37 +- .../Models/SamplesEntities/Task.cs | 37 +- .../Models/SamplesEntities/Territory.cs | 25 +- .../Models/SamplesEntities/UrbanArea.cs | 69 +- .../Models/SamplesEntities/Weather.cs | 29 +- .../signalr-for-aspnet-core/Program.cs | 30 +- .../signalr-for-aspnet-core.csproj | 1 - 33 files changed, 1061 insertions(+), 1119 deletions(-) diff --git a/signalr-hubs/signalr-for-aspnet-core/Hubs/ProductHub.cs b/signalr-hubs/signalr-for-aspnet-core/Hubs/ProductHub.cs index aee2c63..8fa9c64 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Hubs/ProductHub.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Hubs/ProductHub.cs @@ -3,77 +3,72 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Data; -namespace signalr_for_aspnet_core.Hubs +namespace signalr_for_aspnet_core.Hubs; + +public class ProductHub : Hub { - public class ProductHub : Hub + public override System.Threading.Tasks.Task OnConnectedAsync() { - public override System.Threading.Tasks.Task OnConnectedAsync() - { - Groups.AddToGroupAsync(Context.ConnectionId, GetGroupName()); - return base.OnConnectedAsync(); - } + Groups.AddToGroupAsync(Context.ConnectionId, GetGroupName()); + return base.OnConnectedAsync(); + } - public override System.Threading.Tasks.Task OnDisconnectedAsync(Exception e) - { - Groups.RemoveFromGroupAsync(Context.ConnectionId, GetGroupName()); - return base.OnDisconnectedAsync(e); - } + public override System.Threading.Tasks.Task OnDisconnectedAsync(Exception e) + { + Groups.RemoveFromGroupAsync(Context.ConnectionId, GetGroupName()); + return base.OnDisconnectedAsync(e); + } - public IEnumerable Read() + public IEnumerable Read() + { + using var context = new SampleEntitiesDataContext(); + + var products = context.Products.Select(p => new ProductSignalR { - using (var context = new SampleEntitiesDataContext()) + ID = p.ProductID, + ProductName = p.ProductName, + UnitPrice = (double)p.UnitPrice.GetValueOrDefault(), + UnitsInStock = p.UnitsInStock.GetValueOrDefault(), + CreatedAt = DateTime.Now.AddMilliseconds(1), + Category = new CategorySignalR { - - var products = context.Products.Select(p => new ProductSignalR - { - ID = p.ProductID, - ProductName = p.ProductName, - UnitPrice = (double)p.UnitPrice.GetValueOrDefault(), - UnitsInStock = p.UnitsInStock.GetValueOrDefault(), - CreatedAt = DateTime.Now.AddMilliseconds(1), - Category = new CategorySignalR() - { - CategoryID = p.Category.CategoryID, - CategoryName = p.Category.CategoryName - } - }) - .ToList(); - - return products; + CategoryID = p.Category.CategoryID, + CategoryName = p.Category.CategoryName } - } + }).ToList(); - public ProductSignalR Create(ProductSignalR product) - { - product.ID = DateTime.Now.Ticks; - product.CreatedAt = DateTime.Now; - product.Category = product.Category ?? new CategorySignalR() { CategoryID = 1 }; + return products; + } + + public ProductSignalR Create(ProductSignalR product) + { + product.ID = DateTime.Now.Ticks; + product.CreatedAt = DateTime.Now; + product.Category ??= new CategorySignalR { CategoryID = 1 }; - Clients.OthersInGroup(GetGroupName()).SendAsync("create", product); + Clients.OthersInGroup(GetGroupName()).SendAsync("create", product); - return product; - } + return product; + } - public void Update(ProductSignalR product) - { - Clients.OthersInGroup(GetGroupName()).SendAsync("update", product); - } + public void Update(ProductSignalR product) + { + Clients.OthersInGroup(GetGroupName()).SendAsync("update", product); + } - public void Destroy(ProductSignalR product) - { - Clients.OthersInGroup(GetGroupName()).SendAsync("destroy", product); - } + public void Destroy(ProductSignalR product) + { + Clients.OthersInGroup(GetGroupName()).SendAsync("destroy", product); + } - public string GetGroupName() - { - return GetRemoteIpAddress(); - } + public string GetGroupName() + { + return GetRemoteIpAddress(); + } - public string GetRemoteIpAddress() - { - return Context.GetHttpContext()?.Connection.RemoteIpAddress.ToString(); - } + public string GetRemoteIpAddress() + { + return Context.GetHttpContext()?.Connection.RemoteIpAddress?.ToString(); } -} +} \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Models/CategorySignalR.cs b/signalr-hubs/signalr-for-aspnet-core/Models/CategorySignalR.cs index 27c434e..b341652 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Models/CategorySignalR.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Models/CategorySignalR.cs @@ -1,13 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; +namespace signalr_for_aspnet_core.Models; -namespace signalr_for_aspnet_core.Models +public class CategorySignalR { - public class CategorySignalR - { - public int CategoryID { get; set; } - public string CategoryName { get; set; } - } + public int CategoryID { get; set; } + public string CategoryName { get; set; } } \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Models/ProductSignalR.cs b/signalr-hubs/signalr-for-aspnet-core/Models/ProductSignalR.cs index af171cd..ef63ee1 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Models/ProductSignalR.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Models/ProductSignalR.cs @@ -1,17 +1,13 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -namespace signalr_for_aspnet_core.Models +namespace signalr_for_aspnet_core.Models; + +public class ProductSignalR { - public class ProductSignalR - { - public long? ID { get; set; } - public string ProductName { get; set; } - public double UnitPrice { get; set; } - public int UnitsInStock { get; set; } - public DateTime? CreatedAt { get; set; } - public CategorySignalR Category { get; set; } - } + public long? ID { get; set; } + public string ProductName { get; set; } + public double UnitPrice { get; set; } + public int UnitsInStock { get; set; } + public DateTime? CreatedAt { get; set; } + public CategorySignalR Category { get; set; } } \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Models/SampleEntities.cs b/signalr-hubs/signalr-for-aspnet-core/Models/SampleEntities.cs index 4f2cffb..0f83a41 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Models/SampleEntities.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Models/SampleEntities.cs @@ -1,879 +1,872 @@ using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata; using System.IO; -namespace signalr_for_aspnet_core.Models +namespace signalr_for_aspnet_core.Models; + +public partial class SampleEntitiesDataContext() : DbContext(new DbContextOptions()) { - public partial class SampleEntitiesDataContext : DbContext + protected override void OnConfiguring(DbContextOptionsBuilder options) { - public SampleEntitiesDataContext() - : base(new DbContextOptions()) - { - } + var dataDirectory = Path.Combine(Startup.WebRootPath, "App_Data"); - protected override void OnConfiguring(DbContextOptionsBuilder options) - { - var dataDirectory = Path.Combine(Startup.WebRootPath, "App_Data"); - - options.UseSqlite(@"Data Source=" + dataDirectory + System.IO.Path.DirectorySeparatorChar + @"sample.db;"); - } + options.UseSqlite(@"Data Source=" + dataDirectory + System.IO.Path.DirectorySeparatorChar + @"sample.db;"); + } - protected override void OnModelCreating(ModelBuilder modelBuilder) + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder.Entity(entity => { - modelBuilder.Entity(entity => - { - entity.ToTable("Categories"); - - entity.HasKey(e => e.CategoryID); + entity.ToTable("Categories"); - entity.HasIndex(e => e.CategoryName).HasName("Categories_CategoryName"); + entity.HasKey(e => e.CategoryID); - entity.Property(e => e.CategoryName) - .IsRequired() - .HasColumnType("NVARCHAR(15)"); - }); + entity.HasIndex(e => e.CategoryName).HasName("Categories_CategoryName"); - modelBuilder.Entity(entity => - { - entity.ToTable("CustomerCustomerDemo"); + entity.Property(e => e.CategoryName) + .IsRequired() + .HasColumnType("NVARCHAR(15)"); + }); - entity.HasKey(e => new { e.CustomerID, e.CustomerTypeID }); + modelBuilder.Entity(entity => + { + entity.ToTable("CustomerCustomerDemo"); - entity.Property(e => e.CustomerID).HasColumnType("CHAR(5)"); + entity.HasKey(e => new { e.CustomerID, e.CustomerTypeID }); - entity.Property(e => e.CustomerTypeID).HasColumnType("CHAR(10)"); + entity.Property(e => e.CustomerID).HasColumnType("CHAR(5)"); - entity.HasOne(d => d.Customer).WithMany(p => p.CustomerCustomerDemo).HasForeignKey(d => d.CustomerID).OnDelete(DeleteBehavior.Restrict); + entity.Property(e => e.CustomerTypeID).HasColumnType("CHAR(10)"); - entity.HasOne(d => d.CustomerType).WithMany(p => p.CustomerCustomerDemo).HasForeignKey(d => d.CustomerTypeID).OnDelete(DeleteBehavior.Restrict); - }); + entity.HasOne(d => d.Customer).WithMany(p => p.CustomerCustomerDemo).HasForeignKey(d => d.CustomerID).OnDelete(DeleteBehavior.Restrict); - modelBuilder.Entity(entity => - { - entity.ToTable("CustomerDemographics"); - entity.HasKey(e => e.CustomerTypeID); + entity.HasOne(d => d.CustomerType).WithMany(p => p.CustomerCustomerDemo).HasForeignKey(d => d.CustomerTypeID).OnDelete(DeleteBehavior.Restrict); + }); - entity.Property(e => e.CustomerTypeID).HasColumnType("CHAR(10)"); - }); + modelBuilder.Entity(entity => + { + entity.ToTable("CustomerDemographics"); + entity.HasKey(e => e.CustomerTypeID); - modelBuilder.Entity(entity => - { - entity.ToTable("Customers"); + entity.Property(e => e.CustomerTypeID).HasColumnType("CHAR(10)"); + }); - entity.HasKey(e => e.CustomerID); + modelBuilder.Entity(entity => + { + entity.ToTable("Customers"); - entity.HasIndex(e => e.City).HasName("Customers_City"); + entity.HasKey(e => e.CustomerID); - entity.HasIndex(e => e.CompanyName).HasName("Customers_CompanyName"); + entity.HasIndex(e => e.City).HasName("Customers_City"); - entity.HasIndex(e => e.PostalCode).HasName("Customers_PostalCode"); + entity.HasIndex(e => e.CompanyName).HasName("Customers_CompanyName"); - entity.HasIndex(e => e.Region).HasName("Customers_Region"); + entity.HasIndex(e => e.PostalCode).HasName("Customers_PostalCode"); - entity.Property(e => e.CustomerID).HasColumnType("CHAR(5)"); + entity.HasIndex(e => e.Region).HasName("Customers_Region"); - entity.Property(e => e.Address) - .HasColumnType("NVARCHAR(60)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.CustomerID).HasColumnType("CHAR(5)"); - entity.Property(e => e.Bool) - .HasColumnType("BOOLEAN") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.Address) + .HasColumnType("NVARCHAR(60)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.City) - .HasColumnType("NVARCHAR(15)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.Bool) + .HasColumnType("BOOLEAN") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.CompanyName) - .IsRequired() - .HasColumnType("NVARCHAR(40)"); + entity.Property(e => e.City) + .HasColumnType("NVARCHAR(15)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.ContactName) - .HasColumnType("NVARCHAR(30)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.CompanyName) + .IsRequired() + .HasColumnType("NVARCHAR(40)"); - entity.Property(e => e.ContactTitle) - .HasColumnType("NVARCHAR(30)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.ContactName) + .HasColumnType("NVARCHAR(30)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.Country) - .HasColumnType("NVARCHAR(15)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.ContactTitle) + .HasColumnType("NVARCHAR(30)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.Fax) - .HasColumnType("NVARCHAR(24)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.Country) + .HasColumnType("NVARCHAR(15)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.Phone) - .HasColumnType("NVARCHAR(24)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.Fax) + .HasColumnType("NVARCHAR(24)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.PostalCode) - .HasColumnType("NVARCHAR(10)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.Phone) + .HasColumnType("NVARCHAR(24)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.Region) - .HasColumnType("NVARCHAR(15)") - .HasDefaultValueSql("NULL"); - }); + entity.Property(e => e.PostalCode) + .HasColumnType("NVARCHAR(10)") + .HasDefaultValueSql("NULL"); - modelBuilder.Entity(entity => - { - entity.ToTable("EmployeeDirectory"); + entity.Property(e => e.Region) + .HasColumnType("NVARCHAR(15)") + .HasDefaultValueSql("NULL"); + }); - entity.HasKey(e => e.EmployeeID); + modelBuilder.Entity(entity => + { + entity.ToTable("EmployeeDirectory"); - entity.Property(e => e.Address) - .HasColumnType("VARCHAR(255)") - .HasDefaultValueSql("NULL"); + entity.HasKey(e => e.EmployeeID); - entity.Property(e => e.BirthDate) - .HasColumnType("DATETIME") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.Address) + .HasColumnType("VARCHAR(255)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.City) - .HasColumnType("VARCHAR(255)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.BirthDate) + .HasColumnType("DATETIME") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.Country) - .HasColumnType("VARCHAR(100)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.City) + .HasColumnType("VARCHAR(255)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.Extension) - .HasColumnType("INT") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.Country) + .HasColumnType("VARCHAR(100)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.FirstName) - .HasColumnType("VARCHAR(255)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.Extension) + .HasColumnType("INT") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.HireDate) - .HasColumnType("DATETIME") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.FirstName) + .HasColumnType("VARCHAR(255)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.LastName) - .HasColumnType("VARCHAR(255)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.HireDate) + .HasColumnType("DATETIME") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.Phone) - .HasColumnType("VARCHAR(100)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.LastName) + .HasColumnType("VARCHAR(255)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.Position) - .HasColumnType("NVARCHAR(255)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.Phone) + .HasColumnType("VARCHAR(100)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.ReportsTo) - .HasColumnType("INT") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.Position) + .HasColumnType("NVARCHAR(255)") + .HasDefaultValueSql("NULL"); - entity.HasOne(d => d.ReportsToNavigation).WithMany(p => p.InverseReportsToNavigation).HasForeignKey(d => d.ReportsTo); - }); + entity.Property(e => e.ReportsTo) + .HasColumnType("INT") + .HasDefaultValueSql("NULL"); - modelBuilder.Entity(entity => - { - entity.ToTable("EmployeeTerritories"); + entity.HasOne(d => d.ReportsToNavigation).WithMany(p => p.InverseReportsToNavigation).HasForeignKey(d => d.ReportsTo); + }); - entity.HasKey(e => new { e.EmployeeID, e.TerritoryID }); + modelBuilder.Entity(entity => + { + entity.ToTable("EmployeeTerritories"); - entity.Property(e => e.EmployeeID).HasColumnType("INT"); + entity.HasKey(e => new { e.EmployeeID, e.TerritoryID }); - entity.Property(e => e.TerritoryID).HasColumnType("NVARCHAR(20)"); + entity.Property(e => e.EmployeeID).HasColumnType("INT"); - entity.HasOne(d => d.Employee).WithMany(p => p.EmployeeTerritories).HasForeignKey(d => d.EmployeeID).OnDelete(DeleteBehavior.Restrict); + entity.Property(e => e.TerritoryID).HasColumnType("NVARCHAR(20)"); - entity.HasOne(d => d.Territory).WithMany(p => p.EmployeeTerritories).HasForeignKey(d => d.TerritoryID).OnDelete(DeleteBehavior.Restrict); - }); + entity.HasOne(d => d.Employee).WithMany(p => p.EmployeeTerritories).HasForeignKey(d => d.EmployeeID).OnDelete(DeleteBehavior.Restrict); - modelBuilder.Entity(entity => - { - entity.ToTable("Employees"); + entity.HasOne(d => d.Territory).WithMany(p => p.EmployeeTerritories).HasForeignKey(d => d.TerritoryID).OnDelete(DeleteBehavior.Restrict); + }); - entity.HasKey(e => e.EmployeeID); + modelBuilder.Entity(entity => + { + entity.ToTable("Employees"); - entity.HasIndex(e => e.LastName).HasName("Employees_LastName"); + entity.HasKey(e => e.EmployeeID); - entity.HasIndex(e => e.PostalCode).HasName("Employees_PostalCode"); + entity.HasIndex(e => e.LastName).HasName("Employees_LastName"); - entity.Property(e => e.Address) - .HasColumnType("NVARCHAR(60)") - .HasDefaultValueSql("NULL"); + entity.HasIndex(e => e.PostalCode).HasName("Employees_PostalCode"); - entity.Property(e => e.BirthDate) - .HasColumnType("DATETIME") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.Address) + .HasColumnType("NVARCHAR(60)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.City) - .HasColumnType("NVARCHAR(15)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.BirthDate) + .HasColumnType("DATETIME") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.Country) - .HasColumnType("NVARCHAR(15)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.City) + .HasColumnType("NVARCHAR(15)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.Extension) - .HasColumnType("NVARCHAR(4)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.Country) + .HasColumnType("NVARCHAR(15)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.FirstName) - .IsRequired() - .HasColumnType("NVARCHAR(10)"); + entity.Property(e => e.Extension) + .HasColumnType("NVARCHAR(4)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.HireDate) - .HasColumnType("DATETIME") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.FirstName) + .IsRequired() + .HasColumnType("NVARCHAR(10)"); - entity.Property(e => e.HomePhone) - .HasColumnType("NVARCHAR(24)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.HireDate) + .HasColumnType("DATETIME") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.LastName) - .IsRequired() - .HasColumnType("NVARCHAR(20)"); + entity.Property(e => e.HomePhone) + .HasColumnType("NVARCHAR(24)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.PhotoPath) - .HasColumnType("NVARCHAR(255)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.LastName) + .IsRequired() + .HasColumnType("NVARCHAR(20)"); - entity.Property(e => e.PostalCode) - .HasColumnType("NVARCHAR(10)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.PhotoPath) + .HasColumnType("NVARCHAR(255)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.Region) - .HasColumnType("NVARCHAR(15)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.PostalCode) + .HasColumnType("NVARCHAR(10)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.ReportsTo) - .HasColumnType("INT") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.Region) + .HasColumnType("NVARCHAR(15)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.Title) - .HasColumnType("NVARCHAR(30)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.ReportsTo) + .HasColumnType("INT") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.TitleOfCourtesy) - .HasColumnType("NVARCHAR(25)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.Title) + .HasColumnType("NVARCHAR(30)") + .HasDefaultValueSql("NULL"); - entity.HasOne(d => d.ReportsToNavigation).WithMany(p => p.InverseReportsToNavigation).HasForeignKey(d => d.ReportsTo); - }); + entity.Property(e => e.TitleOfCourtesy) + .HasColumnType("NVARCHAR(25)") + .HasDefaultValueSql("NULL"); - modelBuilder.Entity(entity => - { - entity.ToTable("GanttDependencies"); + entity.HasOne(d => d.ReportsToNavigation).WithMany(p => p.InverseReportsToNavigation).HasForeignKey(d => d.ReportsTo); + }); - entity.Property(e => e.PredecessorID).HasColumnType("INT"); + modelBuilder.Entity(entity => + { + entity.ToTable("GanttDependencies"); - entity.Property(e => e.SuccessorID).HasColumnType("INT"); + entity.Property(e => e.PredecessorID).HasColumnType("INT"); - entity.Property(e => e.Type).HasColumnType("INT"); - }); + entity.Property(e => e.SuccessorID).HasColumnType("INT"); - modelBuilder.Entity(entity => - { - entity.ToTable("GanttResourceAssignments"); + entity.Property(e => e.Type).HasColumnType("INT"); + }); - entity.Property(e => e.ResourceID).HasColumnType("INT"); + modelBuilder.Entity(entity => + { + entity.ToTable("GanttResourceAssignments"); - entity.Property(e => e.TaskID).HasColumnType("INT"); + entity.Property(e => e.ResourceID).HasColumnType("INT"); - entity.Property(e => e.Units).HasColumnType("FLOAT(5,2)"); - }); + entity.Property(e => e.TaskID).HasColumnType("INT"); - modelBuilder.Entity(entity => - { - entity.ToTable("GanttResources"); + entity.Property(e => e.Units).HasColumnType("FLOAT(5,2)"); + }); - entity.Property(e => e.Color) - .HasColumnType("CHAR(10)") - .HasDefaultValueSql("NULL"); + modelBuilder.Entity(entity => + { + entity.ToTable("GanttResources"); - entity.Property(e => e.Name) - .IsRequired() - .HasColumnType("NVARCHAR(50)"); - }); + entity.Property(e => e.Color) + .HasColumnType("CHAR(10)") + .HasDefaultValueSql("NULL"); - modelBuilder.Entity(entity => - { - entity.ToTable("GanttTasks"); + entity.Property(e => e.Name) + .IsRequired() + .HasColumnType("NVARCHAR(50)"); + }); - entity.Property(e => e.End) - .IsRequired() - .HasColumnType("DATETIME"); + modelBuilder.Entity(entity => + { + entity.ToTable("GanttTasks"); - entity.Property(e => e.Expanded) - .IsRequired() - .HasColumnType("BOOLEAN"); + entity.Property(e => e.End) + .IsRequired() + .HasColumnType("DATETIME"); - entity.Property(e => e.OrderID).HasColumnType("INT"); + entity.Property(e => e.Expanded) + .IsRequired() + .HasColumnType("BOOLEAN"); - entity.Property(e => e.ParentID) - .HasColumnType("INT") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.OrderID).HasColumnType("INT"); - entity.Property(e => e.PercentComplete).HasColumnType("FLOAT(5,2)"); + entity.Property(e => e.ParentID) + .HasColumnType("INT") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.Start) - .IsRequired() - .HasColumnType("DATETIME"); + entity.Property(e => e.PercentComplete).HasColumnType("FLOAT(5,2)"); - entity.Property(e => e.Summary) - .IsRequired() - .HasColumnType("BOOLEAN"); + entity.Property(e => e.Start) + .IsRequired() + .HasColumnType("DATETIME"); - entity.Property(e => e.Title).IsRequired(); + entity.Property(e => e.Summary) + .IsRequired() + .HasColumnType("BOOLEAN"); - entity.HasOne(d => d.Parent).WithMany(p => p.InverseParent).HasForeignKey(d => d.ParentID); - }); + entity.Property(e => e.Title).IsRequired(); - modelBuilder.Entity(entity => - { - entity.ToTable("Intradays"); + entity.HasOne(d => d.Parent).WithMany(p => p.InverseParent).HasForeignKey(d => d.ParentID); + }); - entity.HasIndex(e => e.Date).HasName("IX_Intraday_Date"); + modelBuilder.Entity(entity => + { + entity.ToTable("Intradays"); - entity.Property(e => e.Close).HasColumnType("FLOAT(9,3)"); + entity.HasIndex(e => e.Date).HasName("IX_Intraday_Date"); - entity.Property(e => e.Date) - .IsRequired() - .HasColumnType("DATETIME"); + entity.Property(e => e.Close).HasColumnType("FLOAT(9,3)"); - entity.Property(e => e.High).HasColumnType("FLOAT(9,3)"); + entity.Property(e => e.Date) + .IsRequired() + .HasColumnType("DATETIME"); - entity.Property(e => e.Low).HasColumnType("FLOAT(9,3)"); + entity.Property(e => e.High).HasColumnType("FLOAT(9,3)"); - entity.Property(e => e.Open).HasColumnType("FLOAT(9,3)"); + entity.Property(e => e.Low).HasColumnType("FLOAT(9,3)"); - entity.Property(e => e.Symbol) - .IsRequired() - .HasColumnType("VARCHAR(10)"); + entity.Property(e => e.Open).HasColumnType("FLOAT(9,3)"); - entity.Property(e => e.Volume).HasColumnType("INT"); - }); + entity.Property(e => e.Symbol) + .IsRequired() + .HasColumnType("VARCHAR(10)"); - modelBuilder.Entity(entity => - { - entity.ToTable("MeetingAttendees"); + entity.Property(e => e.Volume).HasColumnType("INT"); + }); - entity.HasKey(e => new { e.MeetingID, e.AttendeeID }); + modelBuilder.Entity(entity => + { + entity.ToTable("MeetingAttendees"); - entity.Property(e => e.MeetingID).HasColumnType("INT"); + entity.HasKey(e => new { e.MeetingID, e.AttendeeID }); - entity.Property(e => e.AttendeeID).HasColumnType("INT"); + entity.Property(e => e.MeetingID).HasColumnType("INT"); - entity.HasOne(d => d.Meeting).WithMany(p => p.MeetingAttendees).HasForeignKey(d => d.MeetingID).OnDelete(DeleteBehavior.Restrict); - }); + entity.Property(e => e.AttendeeID).HasColumnType("INT"); - modelBuilder.Entity(entity => - { - entity.ToTable("Meetings"); + entity.HasOne(d => d.Meeting).WithMany(p => p.MeetingAttendees).HasForeignKey(d => d.MeetingID).OnDelete(DeleteBehavior.Restrict); + }); - entity.HasKey(e => e.MeetingID); + modelBuilder.Entity(entity => + { + entity.ToTable("Meetings"); - entity.Property(e => e.End) - .IsRequired() - .HasColumnType("DATETIME"); + entity.HasKey(e => e.MeetingID); - entity.Property(e => e.IsAllDay) - .IsRequired() - .HasColumnType("BOOLEAN"); + entity.Property(e => e.End) + .IsRequired() + .HasColumnType("DATETIME"); - entity.Property(e => e.RecurrenceID) - .HasColumnType("INT") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.IsAllDay) + .IsRequired() + .HasColumnType("BOOLEAN"); - entity.Property(e => e.RoomID) - .HasColumnType("INT") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.RecurrenceID) + .HasColumnType("INT") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.Start) - .IsRequired() - .HasColumnType("DATETIME"); + entity.Property(e => e.RoomID) + .HasColumnType("INT") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.Title).IsRequired(); + entity.Property(e => e.Start) + .IsRequired() + .HasColumnType("DATETIME"); - entity.HasOne(d => d.Recurrence).WithMany(p => p.InverseRecurrence).HasForeignKey(d => d.RecurrenceID); - }); + entity.Property(e => e.Title).IsRequired(); - modelBuilder.Entity(entity => - { - entity.ToTable("OrderDetails"); + entity.HasOne(d => d.Recurrence).WithMany(p => p.InverseRecurrence).HasForeignKey(d => d.RecurrenceID); + }); - entity.HasKey(e => new { e.OrderID, e.ProductID }); + modelBuilder.Entity(entity => + { + entity.ToTable("OrderDetails"); - entity.HasIndex(e => e.OrderID).HasName("Order_Details_OrdersOrder_Details"); + entity.HasKey(e => new { e.OrderID, e.ProductID }); - entity.HasIndex(e => e.ProductID).HasName("Order_Details_ProductsOrder_Details"); + entity.HasIndex(e => e.OrderID).HasName("Order_Details_OrdersOrder_Details"); - entity.Property(e => e.OrderID).HasColumnType("INT"); + entity.HasIndex(e => e.ProductID).HasName("Order_Details_ProductsOrder_Details"); - entity.Property(e => e.ProductID).HasColumnType("INT"); + entity.Property(e => e.OrderID).HasColumnType("INT"); - entity.Property(e => e.Discount) - .HasColumnType("REAL(24,0)") - .HasDefaultValueSql("0"); + entity.Property(e => e.ProductID).HasColumnType("INT"); - entity.Property(e => e.Quantity) - .HasColumnType("SMALLINT") - .HasDefaultValueSql("1"); + entity.Property(e => e.Discount) + .HasColumnType("REAL(24,0)") + .HasDefaultValueSql("0"); - entity.Property(e => e.UnitPrice) - .HasColumnType("FLOAT(5,2)") - .HasDefaultValueSql("0"); + entity.Property(e => e.Quantity) + .HasColumnType("SMALLINT") + .HasDefaultValueSql("1"); - entity.HasOne(d => d.Order).WithMany(p => p.OrderDetails).HasForeignKey(d => d.OrderID).OnDelete(DeleteBehavior.Restrict); + entity.Property(e => e.UnitPrice) + .HasColumnType("FLOAT(5,2)") + .HasDefaultValueSql("0"); - entity.HasOne(d => d.Product).WithMany(p => p.OrderDetails).HasForeignKey(d => d.ProductID).OnDelete(DeleteBehavior.Restrict); - }); + entity.HasOne(d => d.Order).WithMany(p => p.OrderDetails).HasForeignKey(d => d.OrderID).OnDelete(DeleteBehavior.Restrict); - modelBuilder.Entity(entity => - { - entity.ToTable("Orders"); + entity.HasOne(d => d.Product).WithMany(p => p.OrderDetails).HasForeignKey(d => d.ProductID).OnDelete(DeleteBehavior.Restrict); + }); - entity.HasKey(e => e.OrderID); + modelBuilder.Entity(entity => + { + entity.ToTable("Orders"); - entity.HasIndex(e => e.CustomerID).HasName("Orders_CustomersOrders"); + entity.HasKey(e => e.OrderID); - entity.HasIndex(e => e.EmployeeID).HasName("Orders_EmployeesOrders"); + entity.HasIndex(e => e.CustomerID).HasName("Orders_CustomersOrders"); - entity.HasIndex(e => e.OrderDate).HasName("Orders_OrderDate"); + entity.HasIndex(e => e.EmployeeID).HasName("Orders_EmployeesOrders"); - entity.HasIndex(e => e.ShipPostalCode).HasName("Orders_ShipPostalCode"); + entity.HasIndex(e => e.OrderDate).HasName("Orders_OrderDate"); - entity.HasIndex(e => e.ShipVia).HasName("Orders_ShippersOrders"); + entity.HasIndex(e => e.ShipPostalCode).HasName("Orders_ShipPostalCode"); - entity.HasIndex(e => e.ShippedDate).HasName("Orders_ShippedDate"); + entity.HasIndex(e => e.ShipVia).HasName("Orders_ShippersOrders"); - entity.Property(e => e.CustomerID) - .HasColumnType("CHAR(5)") - .HasDefaultValueSql("NULL"); + entity.HasIndex(e => e.ShippedDate).HasName("Orders_ShippedDate"); - entity.Property(e => e.EmployeeID) - .HasColumnType("INT") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.CustomerID) + .HasColumnType("CHAR(5)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.Freight) - .HasColumnType("FLOAT(6,2)") - .HasDefaultValueSql("0"); + entity.Property(e => e.EmployeeID) + .HasColumnType("INT") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.OrderDate) - .HasColumnType("DATETIME") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.Freight) + .HasColumnType("FLOAT(6,2)") + .HasDefaultValueSql("0"); - entity.Property(e => e.RequiredDate) - .HasColumnType("DATETIME") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.OrderDate) + .HasColumnType("DATETIME") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.ShipAddress) - .HasColumnType("NVARCHAR(60)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.RequiredDate) + .HasColumnType("DATETIME") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.ShipCity) - .HasColumnType("NVARCHAR(15)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.ShipAddress) + .HasColumnType("NVARCHAR(60)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.ShipCountry) - .HasColumnType("NVARCHAR(15)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.ShipCity) + .HasColumnType("NVARCHAR(15)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.ShipName) - .HasColumnType("NVARCHAR(40)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.ShipCountry) + .HasColumnType("NVARCHAR(15)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.ShippedDate) - .HasColumnType("DATETIME") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.ShipName) + .HasColumnType("NVARCHAR(40)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.ShipPostalCode) - .HasColumnType("NVARCHAR(10)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.ShippedDate) + .HasColumnType("DATETIME") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.ShipRegion) - .HasColumnType("NVARCHAR(15)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.ShipPostalCode) + .HasColumnType("NVARCHAR(10)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.ShipVia) - .HasColumnType("INT") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.ShipRegion) + .HasColumnType("NVARCHAR(15)") + .HasDefaultValueSql("NULL"); - entity.HasOne(d => d.Customer).WithMany(p => p.Orders).HasForeignKey(d => d.CustomerID); + entity.Property(e => e.ShipVia) + .HasColumnType("INT") + .HasDefaultValueSql("NULL"); - entity.HasOne(d => d.Employee).WithMany(p => p.Orders).HasForeignKey(d => d.EmployeeID); + entity.HasOne(d => d.Customer).WithMany(p => p.Orders).HasForeignKey(d => d.CustomerID); - entity.HasOne(d => d.ShipViaNavigation).WithMany(p => p.Orders).HasForeignKey(d => d.ShipVia); - }); + entity.HasOne(d => d.Employee).WithMany(p => p.Orders).HasForeignKey(d => d.EmployeeID); - modelBuilder.Entity(entity => - { - entity.ToTable("OrgChartConnections"); + entity.HasOne(d => d.ShipViaNavigation).WithMany(p => p.Orders).HasForeignKey(d => d.ShipVia); + }); - entity.Property(e => e.FromPointX) - .HasColumnType("INT") - .HasDefaultValueSql("NULL"); + modelBuilder.Entity(entity => + { + entity.ToTable("OrgChartConnections"); - entity.Property(e => e.FromPointY) - .HasColumnType("INT") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.FromPointX) + .HasColumnType("INT") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.FromShapeId) - .HasColumnType("INT") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.FromPointY) + .HasColumnType("INT") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.ToPointX) - .HasColumnType("INT") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.FromShapeId) + .HasColumnType("INT") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.ToPointY) - .HasColumnType("INT") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.ToPointX) + .HasColumnType("INT") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.ToShapeId) - .HasColumnType("INT") - .HasDefaultValueSql("NULL"); - }); + entity.Property(e => e.ToPointY) + .HasColumnType("INT") + .HasDefaultValueSql("NULL"); - modelBuilder.Entity(entity => - { - entity.ToTable("OrgChartShapes"); + entity.Property(e => e.ToShapeId) + .HasColumnType("INT") + .HasDefaultValueSql("NULL"); + }); - entity.Property(e => e.Color) - .HasColumnType("NVARCHAR(50)") - .HasDefaultValueSql("NULL"); + modelBuilder.Entity(entity => + { + entity.ToTable("OrgChartShapes"); - entity.Property(e => e.JobTitle) - .HasColumnType("NVARCHAR(200)") - .HasDefaultValueSql("NULL"); - }); + entity.Property(e => e.Color) + .HasColumnType("NVARCHAR(50)") + .HasDefaultValueSql("NULL"); - modelBuilder.Entity(entity => - { - entity.ToTable("Products"); + entity.Property(e => e.JobTitle) + .HasColumnType("NVARCHAR(200)") + .HasDefaultValueSql("NULL"); + }); - entity.HasKey(e => e.ProductID); + modelBuilder.Entity(entity => + { + entity.ToTable("Products"); - entity.HasIndex(e => e.CategoryID).HasName("Products_CategoryID"); + entity.HasKey(e => e.ProductID); - entity.HasIndex(e => e.ProductName).HasName("Products_ProductName"); + entity.HasIndex(e => e.CategoryID).HasName("Products_CategoryID"); - entity.HasIndex(e => e.SupplierID).HasName("Products_SuppliersProducts"); + entity.HasIndex(e => e.ProductName).HasName("Products_ProductName"); - entity.Property(e => e.CategoryID) - .HasColumnType("INT") - .HasDefaultValueSql("NULL"); + entity.HasIndex(e => e.SupplierID).HasName("Products_SuppliersProducts"); - entity.Property(e => e.Discontinued) - .IsRequired() - .HasColumnType("BOOLEAN") - .HasDefaultValueSql("0"); + entity.Property(e => e.CategoryID) + .HasColumnType("INT") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.ProductName) - .IsRequired() - .HasColumnType("NVARCHAR(40)"); + entity.Property(e => e.Discontinued) + .IsRequired() + .HasColumnType("BOOLEAN") + .HasDefaultValueSql("0"); - entity.Property(e => e.QuantityPerUnit) - .HasColumnType("NVARCHAR(20)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.ProductName) + .IsRequired() + .HasColumnType("NVARCHAR(40)"); - entity.Property(e => e.ReorderLevel) - .HasColumnType("SMALLINT") - .HasDefaultValueSql("0"); + entity.Property(e => e.QuantityPerUnit) + .HasColumnType("NVARCHAR(20)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.SupplierID) - .HasColumnType("INT") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.ReorderLevel) + .HasColumnType("SMALLINT") + .HasDefaultValueSql("0"); - entity.Property(e => e.UnitPrice) - .HasColumnType("FLOAT(5,2)") - .HasDefaultValueSql("0"); + entity.Property(e => e.SupplierID) + .HasColumnType("INT") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.UnitsInStock) - .HasColumnType("SMALLINT") - .HasDefaultValueSql("0"); + entity.Property(e => e.UnitPrice) + .HasColumnType("FLOAT(5,2)") + .HasDefaultValueSql("0"); - entity.Property(e => e.UnitsOnOrder) - .HasColumnType("SMALLINT") - .HasDefaultValueSql("0"); + entity.Property(e => e.UnitsInStock) + .HasColumnType("SMALLINT") + .HasDefaultValueSql("0"); - entity.HasOne(d => d.Category).WithMany(p => p.Products).HasForeignKey(d => d.CategoryID); + entity.Property(e => e.UnitsOnOrder) + .HasColumnType("SMALLINT") + .HasDefaultValueSql("0"); - entity.HasOne(d => d.Supplier).WithMany(p => p.Products).HasForeignKey(d => d.SupplierID); - }); + entity.HasOne(d => d.Category).WithMany(p => p.Products).HasForeignKey(d => d.CategoryID); - modelBuilder.Entity(entity => - { - entity.ToTable("Regions"); + entity.HasOne(d => d.Supplier).WithMany(p => p.Products).HasForeignKey(d => d.SupplierID); + }); - entity.Property(e => e.RegionID).HasColumnType("INT"); + modelBuilder.Entity(entity => + { + entity.ToTable("Regions"); - entity.Property(e => e.RegionDescription) - .IsRequired() - .HasColumnType("CHAR(50)"); - }); + entity.Property(e => e.RegionID).HasColumnType("INT"); - modelBuilder.Entity(entity => - { - entity.ToTable("Shippers"); + entity.Property(e => e.RegionDescription) + .IsRequired() + .HasColumnType("CHAR(50)"); + }); - entity.HasKey(e => e.ShipperID); + modelBuilder.Entity(entity => + { + entity.ToTable("Shippers"); - entity.Property(e => e.CompanyName) - .IsRequired() - .HasColumnType("NVARCHAR(40)"); + entity.HasKey(e => e.ShipperID); - entity.Property(e => e.Phone) - .HasColumnType("NVARCHAR(24)") - .HasDefaultValueSql("NULL"); - }); + entity.Property(e => e.CompanyName) + .IsRequired() + .HasColumnType("NVARCHAR(40)"); - modelBuilder.Entity(entity => - { - entity.ToTable("Stocks"); + entity.Property(e => e.Phone) + .HasColumnType("NVARCHAR(24)") + .HasDefaultValueSql("NULL"); + }); - entity.HasIndex(e => e.Date).HasName("IX_Stock_Date"); + modelBuilder.Entity(entity => + { + entity.ToTable("Stocks"); - entity.Property(e => e.Close).HasColumnType("FLOAT(9,3)"); + entity.HasIndex(e => e.Date).HasName("IX_Stock_Date"); - entity.Property(e => e.Date) - .IsRequired() - .HasColumnType("DATETIME"); + entity.Property(e => e.Close).HasColumnType("FLOAT(9,3)"); - entity.Property(e => e.High).HasColumnType("FLOAT(9,3)"); + entity.Property(e => e.Date) + .IsRequired() + .HasColumnType("DATETIME"); - entity.Property(e => e.Low).HasColumnType("FLOAT(9,3)"); + entity.Property(e => e.High).HasColumnType("FLOAT(9,3)"); - entity.Property(e => e.Open).HasColumnType("FLOAT(9,3)"); + entity.Property(e => e.Low).HasColumnType("FLOAT(9,3)"); - entity.Property(e => e.Symbol) - .IsRequired() - .HasColumnType("VARCHAR(10)"); + entity.Property(e => e.Open).HasColumnType("FLOAT(9,3)"); - entity.Property(e => e.Volume).HasColumnType("INT"); - }); + entity.Property(e => e.Symbol) + .IsRequired() + .HasColumnType("VARCHAR(10)"); - modelBuilder.Entity(entity => - { - entity.ToTable("Suppliers"); + entity.Property(e => e.Volume).HasColumnType("INT"); + }); - entity.HasKey(e => e.SupplierID); + modelBuilder.Entity(entity => + { + entity.ToTable("Suppliers"); - entity.HasIndex(e => e.CompanyName).HasName("Suppliers_CompanyName"); + entity.HasKey(e => e.SupplierID); - entity.HasIndex(e => e.PostalCode).HasName("Suppliers_PostalCode"); + entity.HasIndex(e => e.CompanyName).HasName("Suppliers_CompanyName"); - entity.Property(e => e.Address) - .HasColumnType("NVARCHAR(60)") - .HasDefaultValueSql("NULL"); + entity.HasIndex(e => e.PostalCode).HasName("Suppliers_PostalCode"); - entity.Property(e => e.City) - .HasColumnType("NVARCHAR(15)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.Address) + .HasColumnType("NVARCHAR(60)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.CompanyName) - .IsRequired() - .HasColumnType("NVARCHAR(40)"); + entity.Property(e => e.City) + .HasColumnType("NVARCHAR(15)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.ContactName) - .HasColumnType("NVARCHAR(30)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.CompanyName) + .IsRequired() + .HasColumnType("NVARCHAR(40)"); - entity.Property(e => e.ContactTitle) - .HasColumnType("NVARCHAR(30)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.ContactName) + .HasColumnType("NVARCHAR(30)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.Country) - .HasColumnType("NVARCHAR(15)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.ContactTitle) + .HasColumnType("NVARCHAR(30)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.Fax) - .HasColumnType("NVARCHAR(24)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.Country) + .HasColumnType("NVARCHAR(15)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.Phone) - .HasColumnType("NVARCHAR(24)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.Fax) + .HasColumnType("NVARCHAR(24)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.PostalCode) - .HasColumnType("NVARCHAR(10)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.Phone) + .HasColumnType("NVARCHAR(24)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.Region) - .HasColumnType("NVARCHAR(15)") - .HasDefaultValueSql("NULL"); - }); + entity.Property(e => e.PostalCode) + .HasColumnType("NVARCHAR(10)") + .HasDefaultValueSql("NULL"); - modelBuilder.Entity(entity => - { - entity.ToTable("Tasks"); + entity.Property(e => e.Region) + .HasColumnType("NVARCHAR(15)") + .HasDefaultValueSql("NULL"); + }); - entity.HasKey(e => e.TaskID); + modelBuilder.Entity(entity => + { + entity.ToTable("Tasks"); - entity.Property(e => e.End) - .IsRequired() - .HasColumnType("DATETIME"); + entity.HasKey(e => e.TaskID); - entity.Property(e => e.IsAllDay) - .IsRequired() - .HasColumnType("BOOLEAN"); + entity.Property(e => e.End) + .IsRequired() + .HasColumnType("DATETIME"); - entity.Property(e => e.OwnerID) - .HasColumnType("INT") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.IsAllDay) + .IsRequired() + .HasColumnType("BOOLEAN"); - entity.Property(e => e.RecurrenceID) - .HasColumnType("INT") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.OwnerID) + .HasColumnType("INT") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.Start) - .IsRequired() - .HasColumnType("DATETIME"); + entity.Property(e => e.RecurrenceID) + .HasColumnType("INT") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.Title).IsRequired(); + entity.Property(e => e.Start) + .IsRequired() + .HasColumnType("DATETIME"); - entity.HasOne(d => d.Recurrence).WithMany(p => p.InverseRecurrence).HasForeignKey(d => d.RecurrenceID); - }); + entity.Property(e => e.Title).IsRequired(); - modelBuilder.Entity(entity => - { - entity.ToTable("Territories"); + entity.HasOne(d => d.Recurrence).WithMany(p => p.InverseRecurrence).HasForeignKey(d => d.RecurrenceID); + }); - entity.HasKey(e => e.TerritoryID); + modelBuilder.Entity(entity => + { + entity.ToTable("Territories"); - entity.Property(e => e.TerritoryID).HasColumnType("NVARCHAR(20)"); + entity.HasKey(e => e.TerritoryID); - entity.Property(e => e.RegionID).HasColumnType("INT"); + entity.Property(e => e.TerritoryID).HasColumnType("NVARCHAR(20)"); - entity.Property(e => e.TerritoryDescription) - .IsRequired() - .HasColumnType("CHAR(50)"); + entity.Property(e => e.RegionID).HasColumnType("INT"); - entity.HasOne(d => d.Region).WithMany(p => p.Territories).HasForeignKey(d => d.RegionID).OnDelete(DeleteBehavior.Restrict); - }); + entity.Property(e => e.TerritoryDescription) + .IsRequired() + .HasColumnType("CHAR(50)"); - modelBuilder.Entity(entity => - { - entity.ToTable("UrbanAreas"); + entity.HasOne(d => d.Region).WithMany(p => p.Territories).HasForeignKey(d => d.RegionID).OnDelete(DeleteBehavior.Restrict); + }); - entity.Property(e => e.City) - .IsRequired() - .HasColumnType("NVARCHAR(256)"); + modelBuilder.Entity(entity => + { + entity.ToTable("UrbanAreas"); - entity.Property(e => e.Country) - .IsRequired() - .HasColumnType("NVARCHAR(256)"); + entity.Property(e => e.City) + .IsRequired() + .HasColumnType("NVARCHAR(256)"); - entity.Property(e => e.Country_ISO3) - .IsRequired() - .HasColumnType("CHAR(3)"); + entity.Property(e => e.Country) + .IsRequired() + .HasColumnType("NVARCHAR(256)"); - entity.Property(e => e.Latitude).HasColumnType("FLOAT(9,6)"); + entity.Property(e => e.Country_ISO3) + .IsRequired() + .HasColumnType("CHAR(3)"); - entity.Property(e => e.Longitude).HasColumnType("FLOAT(9,6)"); + entity.Property(e => e.Latitude).HasColumnType("FLOAT(9,6)"); - entity.Property(e => e.Pop1950).HasColumnType("INT"); + entity.Property(e => e.Longitude).HasColumnType("FLOAT(9,6)"); - entity.Property(e => e.Pop1955).HasColumnType("INT"); + entity.Property(e => e.Pop1950).HasColumnType("INT"); - entity.Property(e => e.Pop1960).HasColumnType("INT"); + entity.Property(e => e.Pop1955).HasColumnType("INT"); - entity.Property(e => e.Pop1965).HasColumnType("INT"); + entity.Property(e => e.Pop1960).HasColumnType("INT"); - entity.Property(e => e.Pop1970).HasColumnType("INT"); + entity.Property(e => e.Pop1965).HasColumnType("INT"); - entity.Property(e => e.Pop1975).HasColumnType("INT"); + entity.Property(e => e.Pop1970).HasColumnType("INT"); - entity.Property(e => e.Pop1980).HasColumnType("INT"); + entity.Property(e => e.Pop1975).HasColumnType("INT"); - entity.Property(e => e.Pop1985).HasColumnType("INT"); + entity.Property(e => e.Pop1980).HasColumnType("INT"); - entity.Property(e => e.Pop1990).HasColumnType("INT"); + entity.Property(e => e.Pop1985).HasColumnType("INT"); - entity.Property(e => e.Pop1995).HasColumnType("INT"); + entity.Property(e => e.Pop1990).HasColumnType("INT"); - entity.Property(e => e.Pop2000).HasColumnType("INT"); + entity.Property(e => e.Pop1995).HasColumnType("INT"); - entity.Property(e => e.Pop2005).HasColumnType("INT"); + entity.Property(e => e.Pop2000).HasColumnType("INT"); - entity.Property(e => e.Pop2010).HasColumnType("INT"); + entity.Property(e => e.Pop2005).HasColumnType("INT"); - entity.Property(e => e.Pop2015).HasColumnType("INT"); + entity.Property(e => e.Pop2010).HasColumnType("INT"); - entity.Property(e => e.Pop2020).HasColumnType("INT"); + entity.Property(e => e.Pop2015).HasColumnType("INT"); - entity.Property(e => e.Pop2025).HasColumnType("INT"); + entity.Property(e => e.Pop2020).HasColumnType("INT"); - entity.Property(e => e.Pop2050).HasColumnType("INT"); - }); + entity.Property(e => e.Pop2025).HasColumnType("INT"); - modelBuilder.Entity(entity => - { - entity.ToTable("Weather"); + entity.Property(e => e.Pop2050).HasColumnType("INT"); + }); - entity.HasKey(e => e.ID); + modelBuilder.Entity(entity => + { + entity.ToTable("Weather"); - entity.Property(e => e.Station) - .IsRequired() - .HasColumnType("VARCHAR(255)"); + entity.HasKey(e => e.ID); - entity.Property(e => e.Date) - .IsRequired() - .HasColumnType("DATETIME"); + entity.Property(e => e.Station) + .IsRequired() + .HasColumnType("VARCHAR(255)"); - entity.Property(e => e.TMax) - .IsRequired() - .HasColumnType("FLOAT(5,2)"); + entity.Property(e => e.Date) + .IsRequired() + .HasColumnType("DATETIME"); - entity.Property(e => e.TMin) - .IsRequired() - .HasColumnType("FLOAT(5,2)"); + entity.Property(e => e.TMax) + .IsRequired() + .HasColumnType("FLOAT(5,2)"); - entity.Property(e => e.Wind) - .IsRequired() - .HasColumnType("FLOAT(5,2)"); + entity.Property(e => e.TMin) + .IsRequired() + .HasColumnType("FLOAT(5,2)"); - entity.Property(e => e.Gust) - .HasColumnType("FLOAT(5,2)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.Wind) + .IsRequired() + .HasColumnType("FLOAT(5,2)"); - entity.Property(e => e.Rain) - .IsRequired() - .HasColumnType("FLOAT(5,2)"); + entity.Property(e => e.Gust) + .HasColumnType("FLOAT(5,2)") + .HasDefaultValueSql("NULL"); - entity.Property(e => e.Snow) - .HasColumnType("FLOAT(5,2)") - .HasDefaultValueSql("NULL"); + entity.Property(e => e.Rain) + .IsRequired() + .HasColumnType("FLOAT(5,2)"); - entity.Property(e => e.Events) - .HasColumnType("VARCHAR(255)") - .HasDefaultValueSql("NULL"); - }); - } + entity.Property(e => e.Snow) + .HasColumnType("FLOAT(5,2)") + .HasDefaultValueSql("NULL"); - public virtual DbSet Categories { get; set; } - public virtual DbSet CustomerCustomerDemo { get; set; } - public virtual DbSet CustomerDemographics { get; set; } - public virtual DbSet Customers { get; set; } - public virtual DbSet EmployeeDirectories { get; set; } - public virtual DbSet EmployeeTerritories { get; set; } - public virtual DbSet Employees { get; set; } - public virtual DbSet GanttDependencies { get; set; } - public virtual DbSet GanttResourceAssignments { get; set; } - public virtual DbSet GanttResources { get; set; } - public virtual DbSet GanttTasks { get; set; } - public virtual DbSet Intradays { get; set; } - public virtual DbSet MeetingAttendees { get; set; } - public virtual DbSet Meetings { get; set; } - public virtual DbSet OrderDetails { get; set; } - public virtual DbSet Orders { get; set; } - public virtual DbSet OrgChartConnections { get; set; } - public virtual DbSet OrgChartShapes { get; set; } - public virtual DbSet Products { get; set; } - public virtual DbSet Region { get; set; } - public virtual DbSet Shippers { get; set; } - public virtual DbSet Stocks { get; set; } - public virtual DbSet Suppliers { get; set; } - public virtual DbSet Tasks { get; set; } - public virtual DbSet Territories { get; set; } - public virtual DbSet UrbanAreas { get; set; } - public virtual DbSet Weather { get; set; } + entity.Property(e => e.Events) + .HasColumnType("VARCHAR(255)") + .HasDefaultValueSql("NULL"); + }); } + + public virtual DbSet Categories { get; set; } + public virtual DbSet CustomerCustomerDemo { get; set; } + public virtual DbSet CustomerDemographics { get; set; } + public virtual DbSet Customers { get; set; } + public virtual DbSet EmployeeDirectories { get; set; } + public virtual DbSet EmployeeTerritories { get; set; } + public virtual DbSet Employees { get; set; } + public virtual DbSet GanttDependencies { get; set; } + public virtual DbSet GanttResourceAssignments { get; set; } + public virtual DbSet GanttResources { get; set; } + public virtual DbSet GanttTasks { get; set; } + public virtual DbSet Intradays { get; set; } + public virtual DbSet MeetingAttendees { get; set; } + public virtual DbSet Meetings { get; set; } + public virtual DbSet OrderDetails { get; set; } + public virtual DbSet Orders { get; set; } + public virtual DbSet OrgChartConnections { get; set; } + public virtual DbSet OrgChartShapes { get; set; } + public virtual DbSet Products { get; set; } + public virtual DbSet Region { get; set; } + public virtual DbSet Shippers { get; set; } + public virtual DbSet Stocks { get; set; } + public virtual DbSet Suppliers { get; set; } + public virtual DbSet Tasks { get; set; } + public virtual DbSet Territories { get; set; } + public virtual DbSet UrbanAreas { get; set; } + public virtual DbSet Weather { get; set; } } \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Category.cs b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Category.cs index 494c15d..93b5a92 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Category.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Category.cs @@ -1,20 +1,19 @@ using System; using System.Collections.Generic; -namespace signalr_for_aspnet_core.Models +namespace signalr_for_aspnet_core.Models; + +public partial class Category { - public partial class Category + public Category() { - public Category() - { - Products = new HashSet(); - } + Products = new HashSet(); + } - public int CategoryID { get; set; } - public string CategoryName { get; set; } - public string Description { get; set; } - public byte[] Picture { get; set; } + public int CategoryID { get; set; } + public string CategoryName { get; set; } + public string Description { get; set; } + public byte[] Picture { get; set; } - public virtual ICollection Products { get; set; } - } -} + public virtual ICollection Products { get; set; } +} \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Customer.cs b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Customer.cs index 73de2a3..ad82e0b 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Customer.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Customer.cs @@ -1,30 +1,29 @@ using System; using System.Collections.Generic; -namespace signalr_for_aspnet_core.Models +namespace signalr_for_aspnet_core.Models; + +public partial class Customer { - public partial class Customer + public Customer() { - public Customer() - { CustomerCustomerDemo = new HashSet(); Orders = new HashSet(); } - public string CustomerID { get; set; } - public string Address { get; set; } - public bool Bool { get; set; } - public string City { get; set; } - public string CompanyName { get; set; } - public string ContactName { get; set; } - public string ContactTitle { get; set; } - public string Country { get; set; } - public string Fax { get; set; } - public string Phone { get; set; } - public string PostalCode { get; set; } - public string Region { get; set; } + public string CustomerID { get; set; } + public string Address { get; set; } + public bool Bool { get; set; } + public string City { get; set; } + public string CompanyName { get; set; } + public string ContactName { get; set; } + public string ContactTitle { get; set; } + public string Country { get; set; } + public string Fax { get; set; } + public string Phone { get; set; } + public string PostalCode { get; set; } + public string Region { get; set; } - public virtual ICollection CustomerCustomerDemo { get; set; } - public virtual ICollection Orders { get; set; } - } -} + public virtual ICollection CustomerCustomerDemo { get; set; } + public virtual ICollection Orders { get; set; } +} \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/CustomerCustomerDemo.cs b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/CustomerCustomerDemo.cs index bfebf64..107aa47 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/CustomerCustomerDemo.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/CustomerCustomerDemo.cs @@ -1,14 +1,13 @@ using System; using System.Collections.Generic; -namespace signalr_for_aspnet_core.Models +namespace signalr_for_aspnet_core.Models; + +public partial class CustomerCustomerDemo { - public partial class CustomerCustomerDemo - { - public string CustomerID { get; set; } - public string CustomerTypeID { get; set; } + public string CustomerID { get; set; } + public string CustomerTypeID { get; set; } - public virtual Customer Customer { get; set; } - public virtual CustomerDemographic CustomerType { get; set; } - } -} + public virtual Customer Customer { get; set; } + public virtual CustomerDemographic CustomerType { get; set; } +} \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/CustomerDemographic.cs b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/CustomerDemographic.cs index b731311..1e022ca 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/CustomerDemographic.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/CustomerDemographic.cs @@ -1,18 +1,17 @@ using System; using System.Collections.Generic; -namespace signalr_for_aspnet_core.Models +namespace signalr_for_aspnet_core.Models; + +public partial class CustomerDemographic { - public partial class CustomerDemographic + public CustomerDemographic() { - public CustomerDemographic() - { CustomerCustomerDemo = new HashSet(); } - public string CustomerTypeID { get; set; } - public string CustomerDesc { get; set; } + public string CustomerTypeID { get; set; } + public string CustomerDesc { get; set; } - public virtual ICollection CustomerCustomerDemo { get; set; } - } -} + public virtual ICollection CustomerCustomerDemo { get; set; } +} \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Employee.cs b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Employee.cs index b94efa4..1d2323a 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Employee.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Employee.cs @@ -1,38 +1,37 @@ using System; using System.Collections.Generic; -namespace signalr_for_aspnet_core.Models +namespace signalr_for_aspnet_core.Models; + +public partial class Employee { - public partial class Employee + public Employee() { - public Employee() - { EmployeeTerritories = new HashSet(); Orders = new HashSet(); } - public int EmployeeID { get; set; } - public string Address { get; set; } - public string BirthDate { get; set; } - public string City { get; set; } - public string Country { get; set; } - public string Extension { get; set; } - public string FirstName { get; set; } - public string HireDate { get; set; } - public string HomePhone { get; set; } - public string LastName { get; set; } - public string Notes { get; set; } - public byte[] Photo { get; set; } - public string PhotoPath { get; set; } - public string PostalCode { get; set; } - public string Region { get; set; } - public int? ReportsTo { get; set; } - public string Title { get; set; } - public string TitleOfCourtesy { get; set; } + public int EmployeeID { get; set; } + public string Address { get; set; } + public string BirthDate { get; set; } + public string City { get; set; } + public string Country { get; set; } + public string Extension { get; set; } + public string FirstName { get; set; } + public string HireDate { get; set; } + public string HomePhone { get; set; } + public string LastName { get; set; } + public string Notes { get; set; } + public byte[] Photo { get; set; } + public string PhotoPath { get; set; } + public string PostalCode { get; set; } + public string Region { get; set; } + public int? ReportsTo { get; set; } + public string Title { get; set; } + public string TitleOfCourtesy { get; set; } - public virtual ICollection EmployeeTerritories { get; set; } - public virtual ICollection Orders { get; set; } - public virtual Employee ReportsToNavigation { get; set; } - public virtual ICollection InverseReportsToNavigation { get; set; } - } -} + public virtual ICollection EmployeeTerritories { get; set; } + public virtual ICollection Orders { get; set; } + public virtual Employee ReportsToNavigation { get; set; } + public virtual ICollection InverseReportsToNavigation { get; set; } +} \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/EmployeeDirectory.cs b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/EmployeeDirectory.cs index 91ec721..682abd0 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/EmployeeDirectory.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/EmployeeDirectory.cs @@ -1,24 +1,23 @@ using System; using System.Collections.Generic; -namespace signalr_for_aspnet_core.Models +namespace signalr_for_aspnet_core.Models; + +public partial class EmployeeDirectory { - public partial class EmployeeDirectory - { - public int EmployeeID { get; set; } - public string Address { get; set; } - public DateTime? BirthDate { get; set; } - public string City { get; set; } - public string Country { get; set; } - public int? Extension { get; set; } - public string FirstName { get; set; } - public DateTime? HireDate { get; set; } - public string LastName { get; set; } - public string Phone { get; set; } - public string Position { get; set; } - public int? ReportsTo { get; set; } + public int EmployeeID { get; set; } + public string Address { get; set; } + public DateTime? BirthDate { get; set; } + public string City { get; set; } + public string Country { get; set; } + public int? Extension { get; set; } + public string FirstName { get; set; } + public DateTime? HireDate { get; set; } + public string LastName { get; set; } + public string Phone { get; set; } + public string Position { get; set; } + public int? ReportsTo { get; set; } - public virtual EmployeeDirectory ReportsToNavigation { get; set; } - public virtual ICollection InverseReportsToNavigation { get; set; } - } -} + public virtual EmployeeDirectory ReportsToNavigation { get; set; } + public virtual ICollection InverseReportsToNavigation { get; set; } +} \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/EmployeeTerritory.cs b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/EmployeeTerritory.cs index 14805f8..5f113dd 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/EmployeeTerritory.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/EmployeeTerritory.cs @@ -1,14 +1,13 @@ using System; using System.Collections.Generic; -namespace signalr_for_aspnet_core.Models +namespace signalr_for_aspnet_core.Models; + +public partial class EmployeeTerritory { - public partial class EmployeeTerritory - { - public int EmployeeID { get; set; } - public string TerritoryID { get; set; } + public int EmployeeID { get; set; } + public string TerritoryID { get; set; } - public virtual Employee Employee { get; set; } - public virtual Territory Territory { get; set; } - } -} + public virtual Employee Employee { get; set; } + public virtual Territory Territory { get; set; } +} \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/GanttDependency.cs b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/GanttDependency.cs index 1dd3a2d..a925817 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/GanttDependency.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/GanttDependency.cs @@ -1,13 +1,12 @@ using System; using System.Collections.Generic; -namespace signalr_for_aspnet_core.Models +namespace signalr_for_aspnet_core.Models; + +public partial class GanttDependency { - public partial class GanttDependency - { - public int ID { get; set; } - public int PredecessorID { get; set; } - public int SuccessorID { get; set; } - public int Type { get; set; } - } -} + public int ID { get; set; } + public int PredecessorID { get; set; } + public int SuccessorID { get; set; } + public int Type { get; set; } +} \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/GanttResource.cs b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/GanttResource.cs index 2ebe710..ca97063 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/GanttResource.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/GanttResource.cs @@ -1,12 +1,11 @@ using System; using System.Collections.Generic; -namespace signalr_for_aspnet_core.Models +namespace signalr_for_aspnet_core.Models; + +public partial class GanttResource { - public partial class GanttResource - { - public int ID { get; set; } - public string Color { get; set; } - public string Name { get; set; } - } -} + public int ID { get; set; } + public string Color { get; set; } + public string Name { get; set; } +} \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/GanttResourceAssignment.cs b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/GanttResourceAssignment.cs index a3a3db4..c9c4fe7 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/GanttResourceAssignment.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/GanttResourceAssignment.cs @@ -1,13 +1,12 @@ using System; using System.Collections.Generic; -namespace signalr_for_aspnet_core.Models +namespace signalr_for_aspnet_core.Models; + +public partial class GanttResourceAssignment { - public partial class GanttResourceAssignment - { - public int ID { get; set; } - public int ResourceID { get; set; } - public int TaskID { get; set; } - public decimal Units { get; set; } - } -} + public int ID { get; set; } + public int ResourceID { get; set; } + public int TaskID { get; set; } + public decimal Units { get; set; } +} \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/GanttTask.cs b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/GanttTask.cs index a2fd811..356d3bc 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/GanttTask.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/GanttTask.cs @@ -1,21 +1,20 @@ using System; using System.Collections.Generic; -namespace signalr_for_aspnet_core.Models +namespace signalr_for_aspnet_core.Models; + +public partial class GanttTask { - public partial class GanttTask - { - public int ID { get; set; } - public DateTime End { get; set; } - public bool Expanded { get; set; } - public int OrderID { get; set; } - public int? ParentID { get; set; } - public decimal PercentComplete { get; set; } - public DateTime Start { get; set; } - public bool Summary { get; set; } - public string Title { get; set; } + public int ID { get; set; } + public DateTime End { get; set; } + public bool Expanded { get; set; } + public int OrderID { get; set; } + public int? ParentID { get; set; } + public decimal PercentComplete { get; set; } + public DateTime Start { get; set; } + public bool Summary { get; set; } + public string Title { get; set; } - public virtual GanttTask Parent { get; set; } - public virtual ICollection InverseParent { get; set; } - } -} + public virtual GanttTask Parent { get; set; } + public virtual ICollection InverseParent { get; set; } +} \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Intraday.cs b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Intraday.cs index f7e50da..903578c 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Intraday.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Intraday.cs @@ -1,17 +1,16 @@ using System; using System.Collections.Generic; -namespace signalr_for_aspnet_core.Models +namespace signalr_for_aspnet_core.Models; + +public partial class Intraday { - public partial class Intraday - { - public int ID { get; set; } - public decimal Close { get; set; } - public DateTime Date { get; set; } - public decimal High { get; set; } - public decimal Low { get; set; } - public decimal Open { get; set; } - public string Symbol { get; set; } - public long Volume { get; set; } - } -} + public int ID { get; set; } + public decimal Close { get; set; } + public DateTime Date { get; set; } + public decimal High { get; set; } + public decimal Low { get; set; } + public decimal Open { get; set; } + public string Symbol { get; set; } + public long Volume { get; set; } +} \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Meeting.cs b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Meeting.cs index fcd14c9..2578bbd 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Meeting.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Meeting.cs @@ -1,30 +1,29 @@ using System; using System.Collections.Generic; -namespace signalr_for_aspnet_core.Models +namespace signalr_for_aspnet_core.Models; + +public partial class Meeting { - public partial class Meeting + public Meeting() { - public Meeting() - { MeetingAttendees = new HashSet(); } - public int MeetingID { get; set; } - public string Description { get; set; } - public DateTime End { get; set; } - public string EndTimezone { get; set; } - public bool IsAllDay { get; set; } - public string RecurrenceException { get; set; } - public int? RecurrenceID { get; set; } - public string RecurrenceRule { get; set; } - public int? RoomID { get; set; } - public DateTime Start { get; set; } - public string StartTimezone { get; set; } - public string Title { get; set; } + public int MeetingID { get; set; } + public string Description { get; set; } + public DateTime End { get; set; } + public string EndTimezone { get; set; } + public bool IsAllDay { get; set; } + public string RecurrenceException { get; set; } + public int? RecurrenceID { get; set; } + public string RecurrenceRule { get; set; } + public int? RoomID { get; set; } + public DateTime Start { get; set; } + public string StartTimezone { get; set; } + public string Title { get; set; } - public virtual ICollection MeetingAttendees { get; set; } - public virtual Meeting Recurrence { get; set; } - public virtual ICollection InverseRecurrence { get; set; } - } -} + public virtual ICollection MeetingAttendees { get; set; } + public virtual Meeting Recurrence { get; set; } + public virtual ICollection InverseRecurrence { get; set; } +} \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/MeetingAttendee.cs b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/MeetingAttendee.cs index f3d89e8..74075fa 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/MeetingAttendee.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/MeetingAttendee.cs @@ -1,13 +1,12 @@ using System; using System.Collections.Generic; -namespace signalr_for_aspnet_core.Models +namespace signalr_for_aspnet_core.Models; + +public partial class MeetingAttendee { - public partial class MeetingAttendee - { - public int MeetingID { get; set; } - public int AttendeeID { get; set; } + public int MeetingID { get; set; } + public int AttendeeID { get; set; } - public virtual Meeting Meeting { get; set; } - } -} + public virtual Meeting Meeting { get; set; } +} \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Order.cs b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Order.cs index ac80072..ff7d2c1 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Order.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Order.cs @@ -1,33 +1,32 @@ using System; using System.Collections.Generic; -namespace signalr_for_aspnet_core.Models +namespace signalr_for_aspnet_core.Models; + +public partial class Order { - public partial class Order + public Order() { - public Order() - { OrderDetails = new HashSet(); } - public int OrderID { get; set; } - public string CustomerID { get; set; } - public int? EmployeeID { get; set; } - public decimal? Freight { get; set; } - public DateTime? OrderDate { get; set; } - public string RequiredDate { get; set; } - public string ShipAddress { get; set; } - public string ShipCity { get; set; } - public string ShipCountry { get; set; } - public string ShipName { get; set; } - public DateTime? ShippedDate { get; set; } - public string ShipPostalCode { get; set; } - public string ShipRegion { get; set; } - public int? ShipVia { get; set; } + public int OrderID { get; set; } + public string CustomerID { get; set; } + public int? EmployeeID { get; set; } + public decimal? Freight { get; set; } + public DateTime? OrderDate { get; set; } + public string RequiredDate { get; set; } + public string ShipAddress { get; set; } + public string ShipCity { get; set; } + public string ShipCountry { get; set; } + public string ShipName { get; set; } + public DateTime? ShippedDate { get; set; } + public string ShipPostalCode { get; set; } + public string ShipRegion { get; set; } + public int? ShipVia { get; set; } - public virtual ICollection OrderDetails { get; set; } - public virtual Customer Customer { get; set; } - public virtual Employee Employee { get; set; } - public virtual Shipper ShipViaNavigation { get; set; } - } -} + public virtual ICollection OrderDetails { get; set; } + public virtual Customer Customer { get; set; } + public virtual Employee Employee { get; set; } + public virtual Shipper ShipViaNavigation { get; set; } +} \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/OrderDetail.cs b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/OrderDetail.cs index 5cdaa6d..3dd1fd9 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/OrderDetail.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/OrderDetail.cs @@ -1,17 +1,16 @@ using System; using System.Collections.Generic; -namespace signalr_for_aspnet_core.Models +namespace signalr_for_aspnet_core.Models; + +public partial class OrderDetail { - public partial class OrderDetail - { - public int OrderID { get; set; } - public int ProductID { get; set; } - public double Discount { get; set; } - public int Quantity { get; set; } - public double UnitPrice { get; set; } + public int OrderID { get; set; } + public int ProductID { get; set; } + public double Discount { get; set; } + public int Quantity { get; set; } + public double UnitPrice { get; set; } - public virtual Order Order { get; set; } - public virtual Product Product { get; set; } - } -} + public virtual Order Order { get; set; } + public virtual Product Product { get; set; } +} \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/OrgChartConnection.cs b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/OrgChartConnection.cs index 29168a1..1e49a43 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/OrgChartConnection.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/OrgChartConnection.cs @@ -1,17 +1,16 @@ using System; using System.Collections.Generic; -namespace signalr_for_aspnet_core.Models +namespace signalr_for_aspnet_core.Models; + +public partial class OrgChartConnection { - public partial class OrgChartConnection - { - public long Id { get; set; } - public long? FromPointX { get; set; } - public long? FromPointY { get; set; } - public long? FromShapeId { get; set; } - public string Text { get; set; } - public long? ToPointX { get; set; } - public long? ToPointY { get; set; } - public long? ToShapeId { get; set; } - } -} + public long Id { get; set; } + public long? FromPointX { get; set; } + public long? FromPointY { get; set; } + public long? FromShapeId { get; set; } + public string Text { get; set; } + public long? ToPointX { get; set; } + public long? ToPointY { get; set; } + public long? ToShapeId { get; set; } +} \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/OrgChartShape.cs b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/OrgChartShape.cs index 358bb37..ef12b9b 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/OrgChartShape.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/OrgChartShape.cs @@ -1,12 +1,11 @@ using System; using System.Collections.Generic; -namespace signalr_for_aspnet_core.Models +namespace signalr_for_aspnet_core.Models; + +public partial class OrgChartShape { - public partial class OrgChartShape - { - public int Id { get; set; } - public string Color { get; set; } - public string JobTitle { get; set; } - } -} + public int Id { get; set; } + public string Color { get; set; } + public string JobTitle { get; set; } +} \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Product.cs b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Product.cs index 6dc351b..0a87be7 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Product.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Product.cs @@ -1,28 +1,27 @@ using System; using System.Collections.Generic; -namespace signalr_for_aspnet_core.Models +namespace signalr_for_aspnet_core.Models; + +public partial class Product { - public partial class Product + public Product() { - public Product() - { - OrderDetails = new HashSet(); - } + OrderDetails = new HashSet(); + } - public int ProductID { get; set; } - public int? CategoryID { get; set; } - public bool Discontinued { get; set; } - public string ProductName { get; set; } - public string QuantityPerUnit { get; set; } - public int? ReorderLevel { get; set; } - public int? SupplierID { get; set; } - public decimal? UnitPrice { get; set; } - public int? UnitsInStock { get; set; } - public int? UnitsOnOrder { get; set; } + public int ProductID { get; set; } + public int? CategoryID { get; set; } + public bool Discontinued { get; set; } + public string ProductName { get; set; } + public string QuantityPerUnit { get; set; } + public int? ReorderLevel { get; set; } + public int? SupplierID { get; set; } + public decimal? UnitPrice { get; set; } + public int? UnitsInStock { get; set; } + public int? UnitsOnOrder { get; set; } - public virtual ICollection OrderDetails { get; set; } - public virtual Category Category { get; set; } - public virtual Supplier Supplier { get; set; } - } -} + public virtual ICollection OrderDetails { get; set; } + public virtual Category Category { get; set; } + public virtual Supplier Supplier { get; set; } +} \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Region.cs b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Region.cs index 9e77e77..7d076e1 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Region.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Region.cs @@ -1,18 +1,17 @@ using System; using System.Collections.Generic; -namespace signalr_for_aspnet_core.Models +namespace signalr_for_aspnet_core.Models; + +public partial class Region { - public partial class Region + public Region() { - public Region() - { Territories = new HashSet(); } - public int RegionID { get; set; } - public string RegionDescription { get; set; } + public int RegionID { get; set; } + public string RegionDescription { get; set; } - public virtual ICollection Territories { get; set; } - } -} + public virtual ICollection Territories { get; set; } +} \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Shipper.cs b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Shipper.cs index d793f8a..b76751e 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Shipper.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Shipper.cs @@ -1,19 +1,18 @@ using System; using System.Collections.Generic; -namespace signalr_for_aspnet_core.Models +namespace signalr_for_aspnet_core.Models; + +public partial class Shipper { - public partial class Shipper + public Shipper() { - public Shipper() - { Orders = new HashSet(); } - public int ShipperID { get; set; } - public string CompanyName { get; set; } - public string Phone { get; set; } + public int ShipperID { get; set; } + public string CompanyName { get; set; } + public string Phone { get; set; } - public virtual ICollection Orders { get; set; } - } -} + public virtual ICollection Orders { get; set; } +} \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Stock.cs b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Stock.cs index 5febaaf..0157114 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Stock.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Stock.cs @@ -1,17 +1,16 @@ using System; using System.Collections.Generic; -namespace signalr_for_aspnet_core.Models +namespace signalr_for_aspnet_core.Models; + +public partial class Stock { - public partial class Stock - { - public int ID { get; set; } - public decimal Close { get; set; } - public DateTime Date { get; set; } - public decimal High { get; set; } - public decimal Low { get; set; } - public decimal Open { get; set; } - public string Symbol { get; set; } - public long Volume { get; set; } - } -} + public int ID { get; set; } + public decimal Close { get; set; } + public DateTime Date { get; set; } + public decimal High { get; set; } + public decimal Low { get; set; } + public decimal Open { get; set; } + public string Symbol { get; set; } + public long Volume { get; set; } +} \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Supplier.cs b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Supplier.cs index 565a36a..5ecc3d4 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Supplier.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Supplier.cs @@ -1,28 +1,27 @@ using System; using System.Collections.Generic; -namespace signalr_for_aspnet_core.Models +namespace signalr_for_aspnet_core.Models; + +public partial class Supplier { - public partial class Supplier + public Supplier() { - public Supplier() - { Products = new HashSet(); } - public int SupplierID { get; set; } - public string Address { get; set; } - public string City { get; set; } - public string CompanyName { get; set; } - public string ContactName { get; set; } - public string ContactTitle { get; set; } - public string Country { get; set; } - public string Fax { get; set; } - public string HomePage { get; set; } - public string Phone { get; set; } - public string PostalCode { get; set; } - public string Region { get; set; } + public int SupplierID { get; set; } + public string Address { get; set; } + public string City { get; set; } + public string CompanyName { get; set; } + public string ContactName { get; set; } + public string ContactTitle { get; set; } + public string Country { get; set; } + public string Fax { get; set; } + public string HomePage { get; set; } + public string Phone { get; set; } + public string PostalCode { get; set; } + public string Region { get; set; } - public virtual ICollection Products { get; set; } - } -} + public virtual ICollection Products { get; set; } +} \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Task.cs b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Task.cs index 51ab5d3..11f2ce8 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Task.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Task.cs @@ -1,24 +1,23 @@ using System; using System.Collections.Generic; -namespace signalr_for_aspnet_core.Models +namespace signalr_for_aspnet_core.Models; + +public partial class Task { - public partial class Task - { - public int TaskID { get; set; } - public string Description { get; set; } - public DateTime End { get; set; } - public string EndTimezone { get; set; } - public bool IsAllDay { get; set; } - public int? OwnerID { get; set; } - public string RecurrenceException { get; set; } - public int? RecurrenceID { get; set; } - public string RecurrenceRule { get; set; } - public DateTime Start { get; set; } - public string StartTimezone { get; set; } - public string Title { get; set; } + public int TaskID { get; set; } + public string Description { get; set; } + public DateTime End { get; set; } + public string EndTimezone { get; set; } + public bool IsAllDay { get; set; } + public int? OwnerID { get; set; } + public string RecurrenceException { get; set; } + public int? RecurrenceID { get; set; } + public string RecurrenceRule { get; set; } + public DateTime Start { get; set; } + public string StartTimezone { get; set; } + public string Title { get; set; } - public virtual Task Recurrence { get; set; } - public virtual ICollection InverseRecurrence { get; set; } - } -} + public virtual Task Recurrence { get; set; } + public virtual ICollection InverseRecurrence { get; set; } +} \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Territory.cs b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Territory.cs index 83406dd..36663a5 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Territory.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Territory.cs @@ -1,20 +1,19 @@ using System; using System.Collections.Generic; -namespace signalr_for_aspnet_core.Models +namespace signalr_for_aspnet_core.Models; + +public partial class Territory { - public partial class Territory + public Territory() { - public Territory() - { - EmployeeTerritories = new HashSet(); - } + EmployeeTerritories = new HashSet(); + } - public string TerritoryID { get; set; } - public int RegionID { get; set; } - public string TerritoryDescription { get; set; } + public string TerritoryID { get; set; } + public int RegionID { get; set; } + public string TerritoryDescription { get; set; } - public virtual ICollection EmployeeTerritories { get; set; } - public virtual Region Region { get; set; } - } -} + public virtual ICollection EmployeeTerritories { get; set; } + public virtual Region Region { get; set; } +} \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/UrbanArea.cs b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/UrbanArea.cs index e9f8337..8065e39 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/UrbanArea.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/UrbanArea.cs @@ -1,42 +1,41 @@ using System.ComponentModel.DataAnnotations.Schema; -namespace signalr_for_aspnet_core.Models +namespace signalr_for_aspnet_core.Models; + +public partial class UrbanArea { - public partial class UrbanArea - { - public int ID { get; set; } - public string City { get; set; } - public string Country { get; set; } - public string Country_ISO3 { get; set; } - public double Latitude { get; set; } - public double Longitude { get; set; } - public long Pop1950 { get; set; } - public long Pop1955 { get; set; } - public long Pop1960 { get; set; } - public long Pop1965 { get; set; } - public long Pop1970 { get; set; } - public long Pop1975 { get; set; } - public long Pop1980 { get; set; } - public long Pop1985 { get; set; } - public long Pop1990 { get; set; } - public long Pop1995 { get; set; } - public long Pop2000 { get; set; } - public long Pop2005 { get; set; } - public long Pop2010 { get; set; } - public long Pop2015 { get; set; } - public long Pop2020 { get; set; } - public long Pop2025 { get; set; } - public long Pop2050 { get; set; } + public int ID { get; set; } + public string City { get; set; } + public string Country { get; set; } + public string Country_ISO3 { get; set; } + public double Latitude { get; set; } + public double Longitude { get; set; } + public long Pop1950 { get; set; } + public long Pop1955 { get; set; } + public long Pop1960 { get; set; } + public long Pop1965 { get; set; } + public long Pop1970 { get; set; } + public long Pop1975 { get; set; } + public long Pop1980 { get; set; } + public long Pop1985 { get; set; } + public long Pop1990 { get; set; } + public long Pop1995 { get; set; } + public long Pop2000 { get; set; } + public long Pop2005 { get; set; } + public long Pop2010 { get; set; } + public long Pop2015 { get; set; } + public long Pop2020 { get; set; } + public long Pop2025 { get; set; } + public long Pop2050 { get; set; } - [NotMapped] - public double[] Location + [NotMapped] + public double[] Location + { + get { - get - { - return new double[] { Latitude, Longitude }; - } - - private set { } + return new double[] { Latitude, Longitude }; } + + private set { } } -} +} \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Weather.cs b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Weather.cs index cbacc92..f6b2ee8 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Weather.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Models/SamplesEntities/Weather.cs @@ -1,18 +1,17 @@ using System; -namespace signalr_for_aspnet_core.Models +namespace signalr_for_aspnet_core.Models; + +public partial class Weather { - public partial class Weather - { - public int ID { get; set; } - public string Station { get; set; } - public DateTime Date { get; set; } - public decimal TMax { get; set; } - public decimal TMin { get; set; } - public decimal Wind { get; set; } - public decimal? Gust { get; set; } - public decimal Rain { get; set; } - public decimal? Snow { get; set; } - public string Events { get; set; } - } -} + public int ID { get; set; } + public string Station { get; set; } + public DateTime Date { get; set; } + public decimal TMax { get; set; } + public decimal TMin { get; set; } + public decimal Wind { get; set; } + public decimal? Gust { get; set; } + public decimal Rain { get; set; } + public decimal? Snow { get; set; } + public string Events { get; set; } +} \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Program.cs b/signalr-hubs/signalr-for-aspnet-core/Program.cs index e6978e1..aac3eda 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Program.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Program.cs @@ -1,24 +1,16 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore; +using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.Logging; -namespace signalr_for_aspnet_core +namespace signalr_for_aspnet_core; + +public class Program { - public class Program + public static void Main(string[] args) { - public static void Main(string[] args) - { - CreateWebHostBuilder(args).Build().Run(); - } - - public static IWebHostBuilder CreateWebHostBuilder(string[] args) => - WebHost.CreateDefaultBuilder(args) - .UseStartup(); + CreateWebHostBuilder(args).Build().Run(); } -} + + public static IWebHostBuilder CreateWebHostBuilder(string[] args) => + WebHost.CreateDefaultBuilder(args) + .UseStartup(); +} \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/signalr-for-aspnet-core.csproj b/signalr-hubs/signalr-for-aspnet-core/signalr-for-aspnet-core.csproj index 211ea38..8e70f75 100644 --- a/signalr-hubs/signalr-for-aspnet-core/signalr-for-aspnet-core.csproj +++ b/signalr-hubs/signalr-for-aspnet-core/signalr-for-aspnet-core.csproj @@ -6,6 +6,5 @@ - \ No newline at end of file From d50c2f9274311e2ea4db632a14ec8a4abd08416b Mon Sep 17 00:00:00 2001 From: Lance McCarthy Date: Wed, 8 May 2024 08:27:35 -0400 Subject: [PATCH 3/6] Reconfigure for modern .net8 expectations/compatibility. --- .../signalr-for-aspnet-core/Startup.cs | 74 +++++++++---------- 1 file changed, 35 insertions(+), 39 deletions(-) diff --git a/signalr-hubs/signalr-for-aspnet-core/Startup.cs b/signalr-hubs/signalr-for-aspnet-core/Startup.cs index 228e18a..afdb3ff 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Startup.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Startup.cs @@ -2,53 +2,49 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using Newtonsoft.Json.Serialization; using signalr_for_aspnet_core.Hubs; -namespace signalr_for_aspnet_core +namespace signalr_for_aspnet_core; + +public class Startup { - public class Startup + public Startup(IConfiguration configuration, IHostingEnvironment env) { - public Startup(IConfiguration configuration, IHostingEnvironment env) - { - Configuration = configuration; - WebRootPath = env.WebRootPath; - } + Configuration = configuration; + WebRootPath = env.WebRootPath; + } - public IConfiguration Configuration { get; } + public IConfiguration Configuration { get; } - public static string WebRootPath - { - get; private set; - } + public static string WebRootPath { get; private set; } - // This method gets called by the runtime. Use this method to add services to the container. - // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 - public void ConfigureServices(IServiceCollection services) - { - services.AddCors(options => options.AddPolicy("CorsPolicy", builder => - { - builder - .AllowAnyMethod() - .AllowAnyHeader() - .AllowAnyOrigin() - .AllowCredentials(); - })); - - services.AddSignalR() - .AddJsonProtocol(x => - x.PayloadSerializerSettings.ContractResolver = new DefaultContractResolver()); - - } - - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IHostingEnvironment env) + public void ConfigureServices(IServiceCollection services) + { + services.AddCors(options => options.AddPolicy("CorsPolicy", builder => { - app.UseCors("CorsPolicy"); + builder + .AllowAnyMethod() + .AllowAnyHeader() + .AllowAnyOrigin(); + })); - app.UseFileServer(); + services.AddSignalR().AddJsonProtocol(options => { + options.PayloadSerializerOptions.PropertyNamingPolicy = null; + }); - app.UseSignalR(routes => routes.MapHub("/products")); - } } -} + + public void Configure(IApplicationBuilder app, IHostingEnvironment env) + { + app.UseCors("CorsPolicy"); + + app.UseFileServer(); + + app.UseRouting(); + + app.UseEndpoints(endpoints => + { + endpoints.MapHub("/products"); + }); + } +} \ No newline at end of file From ed3117574c03088e43c0d625edeaba86a2703e03 Mon Sep 17 00:00:00 2001 From: Lance McCarthy Date: Wed, 8 May 2024 09:13:27 -0400 Subject: [PATCH 4/6] Modernize Program.cs --- .../signalr-for-aspnet-core/Program.cs | 46 +++++++++++------ .../signalr-for-aspnet-core/Startup.cs | 50 ------------------- 2 files changed, 30 insertions(+), 66 deletions(-) delete mode 100644 signalr-hubs/signalr-for-aspnet-core/Startup.cs diff --git a/signalr-hubs/signalr-for-aspnet-core/Program.cs b/signalr-hubs/signalr-for-aspnet-core/Program.cs index aac3eda..477e41e 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Program.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Program.cs @@ -1,16 +1,30 @@ -using Microsoft.AspNetCore; -using Microsoft.AspNetCore.Hosting; - -namespace signalr_for_aspnet_core; - -public class Program -{ - public static void Main(string[] args) - { - CreateWebHostBuilder(args).Build().Run(); - } - - public static IWebHostBuilder CreateWebHostBuilder(string[] args) => - WebHost.CreateDefaultBuilder(args) - .UseStartup(); -} \ No newline at end of file +using Microsoft.AspNetCore.Builder; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using signalr_for_aspnet_core.Hubs; +using signalr_for_aspnet_core.Models; + +var builder = WebApplication.CreateBuilder(args); + +builder.Services.AddCors(corsOption => corsOption.AddPolicy("CorsPolicy", corsBuilder => + corsBuilder + .AllowAnyOrigin() + .AllowAnyMethod() + .AllowAnyHeader() + )); + +builder.Services.AddDbContext(options => options.UseSqlite()); + +builder.Services.AddSignalR().AddJsonProtocol(options => { + options.PayloadSerializerOptions.PropertyNamingPolicy = null; +}); + + +var app = builder.Build(); + +app.UseHttpsRedirection(); +app.UseCors("CorsPolicy"); +app.UseRouting(); +app.MapHub("/products"); + +app.Run(); \ No newline at end of file diff --git a/signalr-hubs/signalr-for-aspnet-core/Startup.cs b/signalr-hubs/signalr-for-aspnet-core/Startup.cs deleted file mode 100644 index afdb3ff..0000000 --- a/signalr-hubs/signalr-for-aspnet-core/Startup.cs +++ /dev/null @@ -1,50 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using signalr_for_aspnet_core.Hubs; - -namespace signalr_for_aspnet_core; - -public class Startup -{ - public Startup(IConfiguration configuration, IHostingEnvironment env) - { - Configuration = configuration; - WebRootPath = env.WebRootPath; - } - - public IConfiguration Configuration { get; } - - public static string WebRootPath { get; private set; } - - public void ConfigureServices(IServiceCollection services) - { - services.AddCors(options => options.AddPolicy("CorsPolicy", builder => - { - builder - .AllowAnyMethod() - .AllowAnyHeader() - .AllowAnyOrigin(); - })); - - services.AddSignalR().AddJsonProtocol(options => { - options.PayloadSerializerOptions.PropertyNamingPolicy = null; - }); - - } - - public void Configure(IApplicationBuilder app, IHostingEnvironment env) - { - app.UseCors("CorsPolicy"); - - app.UseFileServer(); - - app.UseRouting(); - - app.UseEndpoints(endpoints => - { - endpoints.MapHub("/products"); - }); - } -} \ No newline at end of file From fe6bb2e5d51ee49da0ceb227bc558f7b869f8260 Mon Sep 17 00:00:00 2001 From: Lance McCarthy Date: Wed, 8 May 2024 09:14:34 -0400 Subject: [PATCH 5/6] Use DependencyInjection for DbContext and IWebHostEnvironment To finish the work in migrating to net8.0, we need to switch from manually instantiating the DBContext and let the framework properly inject the required services. --- .../signalr-for-aspnet-core/Hubs/ProductHub.cs | 9 ++++----- .../signalr-for-aspnet-core/Models/SampleEntities.cs | 11 ++++------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/signalr-hubs/signalr-for-aspnet-core/Hubs/ProductHub.cs b/signalr-hubs/signalr-for-aspnet-core/Hubs/ProductHub.cs index 8fa9c64..6e4398f 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Hubs/ProductHub.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Hubs/ProductHub.cs @@ -3,18 +3,19 @@ using System; using System.Collections.Generic; using System.Linq; +using Task = System.Threading.Tasks.Task; namespace signalr_for_aspnet_core.Hubs; -public class ProductHub : Hub +public class ProductHub(SampleEntitiesDataContext context) : Hub { - public override System.Threading.Tasks.Task OnConnectedAsync() + public override Task OnConnectedAsync() { Groups.AddToGroupAsync(Context.ConnectionId, GetGroupName()); return base.OnConnectedAsync(); } - public override System.Threading.Tasks.Task OnDisconnectedAsync(Exception e) + public override Task OnDisconnectedAsync(Exception e) { Groups.RemoveFromGroupAsync(Context.ConnectionId, GetGroupName()); return base.OnDisconnectedAsync(e); @@ -22,8 +23,6 @@ public override System.Threading.Tasks.Task OnDisconnectedAsync(Exception e) public IEnumerable Read() { - using var context = new SampleEntitiesDataContext(); - var products = context.Products.Select(p => new ProductSignalR { ID = p.ProductID, diff --git a/signalr-hubs/signalr-for-aspnet-core/Models/SampleEntities.cs b/signalr-hubs/signalr-for-aspnet-core/Models/SampleEntities.cs index 0f83a41..3e29a94 100644 --- a/signalr-hubs/signalr-for-aspnet-core/Models/SampleEntities.cs +++ b/signalr-hubs/signalr-for-aspnet-core/Models/SampleEntities.cs @@ -1,16 +1,13 @@ +using Microsoft.AspNetCore.Hosting; using Microsoft.EntityFrameworkCore; using System.IO; namespace signalr_for_aspnet_core.Models; -public partial class SampleEntitiesDataContext() : DbContext(new DbContextOptions()) +public class SampleEntitiesDataContext(IWebHostEnvironment environment) : DbContext(new DbContextOptions()) { - protected override void OnConfiguring(DbContextOptionsBuilder options) - { - var dataDirectory = Path.Combine(Startup.WebRootPath, "App_Data"); - - options.UseSqlite(@"Data Source=" + dataDirectory + System.IO.Path.DirectorySeparatorChar + @"sample.db;"); - } + protected override void OnConfiguring(DbContextOptionsBuilder options) => + options.UseSqlite($"Data Source={Path.Join(environment.WebRootPath, "App_Data", "sample.db")}"); protected override void OnModelCreating(ModelBuilder modelBuilder) { From 139d435696a15bb927bca8f02606148542d198dc Mon Sep 17 00:00:00 2001 From: Lance McCarthy Date: Fri, 11 Oct 2024 08:57:56 -0400 Subject: [PATCH 6/6] Update signalr-for-aspnet-core.csproj Bump EntityFramework Sqlite --- .../signalr-for-aspnet-core/signalr-for-aspnet-core.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/signalr-hubs/signalr-for-aspnet-core/signalr-for-aspnet-core.csproj b/signalr-hubs/signalr-for-aspnet-core/signalr-for-aspnet-core.csproj index 8e70f75..d045050 100644 --- a/signalr-hubs/signalr-for-aspnet-core/signalr-for-aspnet-core.csproj +++ b/signalr-hubs/signalr-for-aspnet-core/signalr-for-aspnet-core.csproj @@ -5,6 +5,6 @@ - + \ No newline at end of file