diff --git a/Bulky.Models/ApplicationUser.cs b/Bulky.Models/ApplicationUser.cs index be486c3..43fcc11 100644 --- a/Bulky.Models/ApplicationUser.cs +++ b/Bulky.Models/ApplicationUser.cs @@ -20,6 +20,6 @@ public class ApplicationUser : IdentityUser public int? CompanyId { get; set; } [ForeignKey("CompanyId")] [ValidateNever] - public Company Company { get; set; } + public Company? Company { get; set; } } } diff --git a/Bulky.Models/OrderDetail.cs b/Bulky.Models/OrderDetail.cs index 767d7c9..8274b77 100644 --- a/Bulky.Models/OrderDetail.cs +++ b/Bulky.Models/OrderDetail.cs @@ -19,7 +19,7 @@ public class OrderDetail [ValidateNever] public Product? Product { get; set; } - public int? Count { get; set; } - public double? Price { get; set; } + public int Count { get; set; } + public double Price { get; set; } } } diff --git a/Bulky.Models/OrderHeader.cs b/Bulky.Models/OrderHeader.cs index 8499a5e..a1bb817 100644 --- a/Bulky.Models/OrderHeader.cs +++ b/Bulky.Models/OrderHeader.cs @@ -15,7 +15,7 @@ public class OrderHeader public DateTime OrderDate { get; set; } public DateTime ShippingDate { get; set; } - public double? OrderTotal { get; set; } + public double OrderTotal { get; set; } public string? OrderStatus { get; set; } public string? PaymentStatus { get; set; } diff --git a/Bulky.Models/Product.cs b/Bulky.Models/Product.cs index 9b2a009..4e7743a 100644 --- a/Bulky.Models/Product.cs +++ b/Bulky.Models/Product.cs @@ -22,29 +22,29 @@ public class Product [Required] [Display(Name = "List Price")] [Range(1, 1000)] - public double? ListPrice { get; set; } + public double ListPrice { get; set; } [Required] [Display(Name = "Price for 1-50")] [Range(1, 1000)] - public double? Price { get; set; } + public double Price { get; set; } [Required] [Display(Name = "Price for 50+")] [Range(1, 1000)] - public double? Price50 { get; set; } + public double Price50 { get; set; } [Required] [Display(Name = "Price for 100+")] [Range(1, 1000)] - public double? Price100 { get; set; } + public double Price100 { get; set; } [Required] [Display(Name = "Category")] public int? CategoryId { get; set; } [ForeignKey("CategoryId")] [ValidateNever] - public Category? Category { get; set; } + public Category Category { get; set; } [ValidateNever] public string? ImageURL { get; set; } diff --git a/Bulky.Models/ShoppingCart.cs b/Bulky.Models/ShoppingCart.cs index e3b3a1b..31bd3f9 100644 --- a/Bulky.Models/ShoppingCart.cs +++ b/Bulky.Models/ShoppingCart.cs @@ -10,7 +10,7 @@ public class ShoppingCart public int Id { get; set; } [Required] [Range(1, 1000, ErrorMessage = "Please enter a value between 1 and 1000.")] - public int? Count { get; set; } + public int Count { get; set; } public int? ProductId { get; set; } [ForeignKey("ProductId")] [ValidateNever] @@ -21,6 +21,6 @@ public class ShoppingCart public ApplicationUser? ApplicationUser { get; set; } [NotMapped] - public double? Price { get; set; } + public double Price { get; set; } } } diff --git a/BulkyWeb/Properties/ServiceDependencies/BulkyWebAppService01092024/mssql1.arm.json b/BulkyWeb/Properties/ServiceDependencies/BulkyWebAppService01092024/mssql1.arm.json new file mode 100644 index 0000000..80ad939 --- /dev/null +++ b/BulkyWeb/Properties/ServiceDependencies/BulkyWebAppService01092024/mssql1.arm.json @@ -0,0 +1,81 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "resourceGroupName": { + "type": "string", + "defaultValue": "DefaultResourceGroup-EUS2", + "metadata": { + "_parameterType": "resourceGroup", + "description": "Name of the resource group for the resource. It is recommended to put resources under same resource group for better tracking." + } + }, + "resourceGroupLocation": { + "type": "string", + "defaultValue": "eastus2", + "metadata": { + "_parameterType": "location", + "description": "Location of the resource group. Resource groups could have different location than resources." + } + }, + "resourceLocation": { + "type": "string", + "defaultValue": "[parameters('resourceGroupLocation')]", + "metadata": { + "_parameterType": "location", + "description": "Location of the resource. By default use resource group's location, unless the resource provider is not supported there." + } + } + }, + "resources": [ + { + "type": "Microsoft.Resources/resourceGroups", + "name": "[parameters('resourceGroupName')]", + "location": "[parameters('resourceGroupLocation')]", + "apiVersion": "2019-10-01" + }, + { + "type": "Microsoft.Resources/deployments", + "name": "[concat(parameters('resourceGroupName'), 'Deployment', uniqueString(concat('BulkyWeb_db', subscription().subscriptionId)))]", + "resourceGroup": "[parameters('resourceGroupName')]", + "apiVersion": "2019-10-01", + "dependsOn": [ + "[parameters('resourceGroupName')]" + ], + "properties": { + "mode": "Incremental", + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "resources": [ + { + "kind": "v12.0", + "location": "[parameters('resourceLocation')]", + "name": "bulkywebdb", + "type": "Microsoft.Sql/servers", + "apiVersion": "2017-10-01-preview" + }, + { + "sku": { + "name": "Standard", + "tier": "Standard", + "capacity": 10 + }, + "kind": "v12.0,user", + "location": "[parameters('resourceLocation')]", + "name": "bulkywebdb/BulkyWeb_db", + "type": "Microsoft.Sql/servers/databases", + "apiVersion": "2017-10-01-preview", + "dependsOn": [ + "bulkywebdb" + ] + } + ] + } + } + } + ], + "metadata": { + "_dependencyType": "mssql.azure" + } +} \ No newline at end of file diff --git a/BulkyWeb/Properties/serviceDependencies.BulkyWebAppService01092024.json b/BulkyWeb/Properties/serviceDependencies.BulkyWebAppService01092024.json new file mode 100644 index 0000000..927a894 --- /dev/null +++ b/BulkyWeb/Properties/serviceDependencies.BulkyWebAppService01092024.json @@ -0,0 +1,11 @@ +{ + "dependencies": { + "mssql1": { + "serviceConnectorResourceId": "/subscriptions/[parameters('subscriptionId')]/resourceGroups/[parameters('resourceGroupName')]/providers/Microsoft.Web/sites/BulkyWebAppService01092024/providers/Microsoft.ServiceLinker/linkers/ConnectionStringsAzureDb_71A18EBE74", + "secretStore": "AzureAppSettings", + "resourceId": "/subscriptions/[parameters('subscriptionId')]/resourcegroups/[parameters('resourceGroupName')]/providers/Microsoft.Sql/servers/bulkywebdb/databases/BulkyWeb_db", + "type": "mssql.azure", + "connectionId": "ConnectionStrings:AzureDb" + } + } +} \ No newline at end of file diff --git a/BulkyWeb/Properties/serviceDependencies.json b/BulkyWeb/Properties/serviceDependencies.json index 33703d5..a608248 100644 --- a/BulkyWeb/Properties/serviceDependencies.json +++ b/BulkyWeb/Properties/serviceDependencies.json @@ -1,3 +1,8 @@ { - "dependencies": {} + "dependencies": { + "mssql1": { + "type": "mssql", + "connectionId": "ConnectionStrings:AzureDb" + } + } } \ No newline at end of file