#60 GanjoorMetre entity

This commit is contained in:
Hamid Reza Mohammadi 2021-01-08 20:58:40 +03:30
parent 43d4ab2436
commit 78f585883c
8 changed files with 1974 additions and 1 deletions

View File

@ -192,5 +192,10 @@ namespace RMuseum.DbContext
/// </summary>
public DbSet<GanjoorPage> GanjoorPages { get; set; }
/// <summary>
/// Ganjoor Metres
/// </summary>
public DbSet<GanjoorMetre> GanjoorMetres { get; set; }
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,62 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace RMuseum.Migrations
{
public partial class GanjoorMetres : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "GanjoorMetreId",
table: "GanjoorPoems",
nullable: true);
migrationBuilder.CreateTable(
name: "GanjoorMetres",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
UrlSlug = table.Column<string>(nullable: true),
Rhythm = table.Column<string>(nullable: true),
Name = table.Column<string>(nullable: true),
Description = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_GanjoorMetres", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_GanjoorPoems_GanjoorMetreId",
table: "GanjoorPoems",
column: "GanjoorMetreId");
migrationBuilder.AddForeignKey(
name: "FK_GanjoorPoems_GanjoorMetres_GanjoorMetreId",
table: "GanjoorPoems",
column: "GanjoorMetreId",
principalTable: "GanjoorMetres",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_GanjoorPoems_GanjoorMetres_GanjoorMetreId",
table: "GanjoorPoems");
migrationBuilder.DropTable(
name: "GanjoorMetres");
migrationBuilder.DropIndex(
name: "IX_GanjoorPoems_GanjoorMetreId",
table: "GanjoorPoems");
migrationBuilder.DropColumn(
name: "GanjoorMetreId",
table: "GanjoorPoems");
}
}
}

View File

@ -367,6 +367,30 @@ namespace RMuseum.Migrations
b.ToTable("GanjoorCategories");
});
modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorMetre", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("Description")
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.HasColumnType("nvarchar(max)");
b.Property<string>("Rhythm")
.HasColumnType("nvarchar(max)");
b.Property<string>("UrlSlug")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("GanjoorMetres");
});
modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPage", b =>
{
b.Property<int>("Id")
@ -445,6 +469,9 @@ namespace RMuseum.Migrations
b.Property<string>("FullUrl")
.HasColumnType("nvarchar(450)");
b.Property<int?>("GanjoorMetreId")
.HasColumnType("int");
b.Property<string>("HtmlText")
.HasColumnType("nvarchar(max)");
@ -463,6 +490,8 @@ namespace RMuseum.Migrations
b.HasIndex("FullUrl");
b.HasIndex("GanjoorMetreId");
b.ToTable("GanjoorPoems");
});
@ -1551,6 +1580,10 @@ namespace RMuseum.Migrations
.HasForeignKey("CatId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("RMuseum.Models.Ganjoor.GanjoorMetre", "GanjoorMetre")
.WithMany()
.HasForeignKey("GanjoorMetreId");
});
modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorVerse", b =>

View File

@ -0,0 +1,37 @@
namespace RMuseum.Models.Ganjoor
{
/// <summary>
/// Poem prosodic Metre
/// </summary>
public class GanjoorMetre
{
/// <summary>
/// Id
/// </summary>
public int Id { get; set; }
/// <summary>
/// Url Slug
/// </summary>
public string UrlSlug { get; set; }
/// <summary>
/// Rythm
/// </summary>
/// <example>مفاعیلن مفاعیلن فعولن</example>
public string Rhythm { get; set; }
/// <summary>
/// Name
/// </summary>
/// <example>
/// هزج مسدس محذوف
/// </example>
public string Name { get; set; }
/// <summary>
/// Description
/// </summary>
public string Description { get; set; }
}
}

View File

@ -53,5 +53,20 @@ namespace RMuseum.Models.Ganjoor
/// verses text as html (ganjoor.net format)
/// </summary>
public string HtmlText { get; set; }
/// <summary>
/// prosody information
/// </summary>
/// <remarks>
/// in fact this should be a many-to-many relationship, but our current dataset lacks such a relationship instance and
/// because in fact it is actuallay this relationship should exists between a non-existant entity called block of poem
/// I ignored this relationship to take care of it whenever the block entity would be added to the data structure
/// </remarks>
public int? GanjoorMetreId { get; set; }
/// <summary>
/// metre
/// </summary>
public virtual GanjoorMetre GanjoorMetre { get; set; }
}
}

View File

@ -1221,6 +1221,11 @@
Ganjoor Pages
</summary>
</member>
<member name="P:RMuseum.DbContext.RMuseumDbContext.GanjoorMetres">
<summary>
Ganjoor Metres
</summary>
</member>
<member name="T:RMuseum.Models.Artifact.PublishStatus">
<summary>
Items or pictures status
@ -3366,6 +3371,40 @@
sample: /hafez/ghazal
</summary>
</member>
<member name="T:RMuseum.Models.Ganjoor.GanjoorMetre">
<summary>
Poem prosodic Metre
</summary>
</member>
<member name="P:RMuseum.Models.Ganjoor.GanjoorMetre.Id">
<summary>
Id
</summary>
</member>
<member name="P:RMuseum.Models.Ganjoor.GanjoorMetre.UrlSlug">
<summary>
Url Slug
</summary>
</member>
<member name="P:RMuseum.Models.Ganjoor.GanjoorMetre.Rhythm">
<summary>
Rythm
</summary>
<example>مفاعیلن مفاعیلن فعولن</example>
</member>
<member name="P:RMuseum.Models.Ganjoor.GanjoorMetre.Name">
<summary>
Name
</summary>
<example>
هزج مسدس محذوف
</example>
</member>
<member name="P:RMuseum.Models.Ganjoor.GanjoorMetre.Description">
<summary>
Description
</summary>
</member>
<member name="T:RMuseum.Models.Ganjoor.GanjoorPageType">
<summary>
Ganjoor Page Type
@ -3566,6 +3605,21 @@
verses text as html (ganjoor.net format)
</summary>
</member>
<member name="P:RMuseum.Models.Ganjoor.GanjoorPoem.GanjoorMetreId">
<summary>
prosody information
</summary>
<remarks>
in fact this should be a many-to-many relationship, but our current dataset lacks such a relationship instance and
because in fact it is actuallay this relationship should exists between a non-existant entity called block of poem
I ignored this relationship to take care of it whenever the block entity would be added to the data structure
</remarks>
</member>
<member name="P:RMuseum.Models.Ganjoor.GanjoorPoem.GanjoorMetre">
<summary>
metre
</summary>
</member>
<member name="T:RMuseum.Models.Ganjoor.GanjoorPoet">
<summary>
Ganjoor Poet

View File

@ -28,7 +28,7 @@
"From": "test@gmail.com"
},
"LocalSqliteImport": {
"FilePath": "C:\\Users\\moham\\AppData\\Local\\ganjoor\\ganjoor.s3db"
"FilePath": "C:\\Users\\moham\\AppData\\Local\\ganjoor\\ganjoor\\ganjoor.s3db"
},
"IIS": {
"UploadLimit": "52428800"