Commit 56b44861 authored by Almouhannad's avatar Almouhannad

(B) Add amount value to medicines

parent 219cd6d0
...@@ -11,6 +11,8 @@ public sealed class Medicine(int id) : Entity(id) ...@@ -11,6 +11,8 @@ public sealed class Medicine(int id) : Entity(id)
public MedicineForm MedicineForm { get; set; } = null!; public MedicineForm MedicineForm { get; set; } = null!;
public int Amount { get; set; }
public string Name { get; set; } = null!; public string Name { get; set; } = null!;
public decimal Dosage { get; set; } public decimal Dosage { get; set; }
......
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Persistence.Migrations
{
/// <inheritdoc />
public partial class Add_Amount_To_Medicine : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "Amount",
table: "Medicine",
type: "int",
nullable: false,
defaultValue: 0);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Amount",
table: "Medicine");
}
}
}
...@@ -110,6 +110,9 @@ namespace Persistence.Migrations ...@@ -110,6 +110,9 @@ namespace Persistence.Migrations
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("Amount")
.HasColumnType("int");
b.Property<decimal>("Dosage") b.Property<decimal>("Dosage")
.HasColumnType("numeric(9, 3)"); .HasColumnType("numeric(9, 3)");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment