#92 new fields for GanjoorPoet
This commit is contained in:
parent
eead895dfb
commit
6eee8a78df
2211
RMuseum/Migrations/20210315133248_PoetNewFields.Designer.cs
generated
Normal file
2211
RMuseum/Migrations/20210315133248_PoetNewFields.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
63
RMuseum/Migrations/20210315133248_PoetNewFields.cs
Normal file
63
RMuseum/Migrations/20210315133248_PoetNewFields.cs
Normal file
@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace RMuseum.Migrations
|
||||
{
|
||||
public partial class PoetNewFields : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Nickname",
|
||||
table: "GanjoorPoets",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "Published",
|
||||
table: "GanjoorPoets",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "RImageId",
|
||||
table: "GanjoorPoets",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GanjoorPoets_RImageId",
|
||||
table: "GanjoorPoets",
|
||||
column: "RImageId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_GanjoorPoets_GeneralImages_RImageId",
|
||||
table: "GanjoorPoets",
|
||||
column: "RImageId",
|
||||
principalTable: "GeneralImages",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_GanjoorPoets_GeneralImages_RImageId",
|
||||
table: "GanjoorPoets");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_GanjoorPoets_RImageId",
|
||||
table: "GanjoorPoets");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Nickname",
|
||||
table: "GanjoorPoets");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Published",
|
||||
table: "GanjoorPoets");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "RImageId",
|
||||
table: "GanjoorPoets");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -600,8 +600,19 @@ namespace RMuseum.Migrations
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Nickname")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("Published")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<Guid?>("RImageId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RImageId");
|
||||
|
||||
b.ToTable("GanjoorPoets");
|
||||
});
|
||||
|
||||
@ -1947,6 +1958,13 @@ namespace RMuseum.Migrations
|
||||
.HasForeignKey("GanjoorMetreId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoet", b =>
|
||||
{
|
||||
b.HasOne("RSecurityBackend.Models.Image.RImage", "RImage")
|
||||
.WithMany()
|
||||
.HasForeignKey("RImageId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorVerse", b =>
|
||||
{
|
||||
b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoem", "Poem")
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using RSecurityBackend.Models.Image;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace RMuseum.Models.Ganjoor
|
||||
@ -7,9 +9,9 @@ namespace RMuseum.Models.Ganjoor
|
||||
/// Ganjoor Poet
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// cat_id field is removed, it is retrievable by querying <see cref="RMuseum.Models.Ganjoor.GanjoorCat"/>
|
||||
/// where <see cref="RMuseum.Models.Ganjoor.GanjoorCat.PoetId"/> == <see cref="RMuseum.Models.Ganjoor.GanjoorPoet.Id"/> and
|
||||
/// <see cref="RMuseum.Models.Ganjoor.GanjoorCat.Parent"/> == null
|
||||
/// cat_id field is removed, it is retrievable by querying <see cref="GanjoorCat"/>
|
||||
/// where <see cref="GanjoorCat.PoetId"/> == <see cref="Id"/> and
|
||||
/// <see cref="GanjoorCat.Parent"/> == null
|
||||
/// </remarks>
|
||||
public class GanjoorPoet
|
||||
{
|
||||
@ -28,5 +30,25 @@ namespace RMuseum.Models.Ganjoor
|
||||
/// description
|
||||
/// </summary>
|
||||
public string Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// short name
|
||||
/// </summary>
|
||||
public string Nickname { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// poet image
|
||||
/// </summary>
|
||||
public virtual RImage RImage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// user image id
|
||||
/// </summary>
|
||||
public Guid? RImageId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// published on website
|
||||
/// </summary>
|
||||
public bool Published { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,5 +29,20 @@
|
||||
/// root cat id
|
||||
/// </summary>
|
||||
public int RootCatId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// short name
|
||||
/// </summary>
|
||||
public string Nickname { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// published on website
|
||||
/// </summary>
|
||||
public bool Published { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// image url
|
||||
/// </summary>
|
||||
public string ImageUrl { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -4016,6 +4016,26 @@
|
||||
description
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:RMuseum.Models.Ganjoor.GanjoorPoet.Nickname">
|
||||
<summary>
|
||||
short name
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:RMuseum.Models.Ganjoor.GanjoorPoet.RImage">
|
||||
<summary>
|
||||
poet image
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:RMuseum.Models.Ganjoor.GanjoorPoet.RImageId">
|
||||
<summary>
|
||||
user image id
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:RMuseum.Models.Ganjoor.GanjoorPoet.Published">
|
||||
<summary>
|
||||
published on website
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:RMuseum.Models.Ganjoor.GanjoorVerse">
|
||||
<summary>
|
||||
Ganjoor Verse
|
||||
@ -4702,6 +4722,21 @@
|
||||
root cat id
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:RMuseum.Models.Ganjoor.ViewModels.GanjoorPoetViewModel.Nickname">
|
||||
<summary>
|
||||
short name
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:RMuseum.Models.Ganjoor.ViewModels.GanjoorPoetViewModel.Published">
|
||||
<summary>
|
||||
published on website
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:RMuseum.Models.Ganjoor.ViewModels.GanjoorPoetViewModel.ImageUrl">
|
||||
<summary>
|
||||
image url
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:RMuseum.Models.Ganjoor.ViewModels.GanjoorPostReportCommentViewModel">
|
||||
<summary>
|
||||
report comment view model
|
||||
|
||||
@ -49,7 +49,10 @@ namespace RMuseum.Services.Implementation
|
||||
Name = poet.Name,
|
||||
Description = includeBio ? poet.Description : null,
|
||||
FullUrl = cat.FullUrl,
|
||||
RootCatId = cat.Id
|
||||
RootCatId = cat.Id,
|
||||
Nickname = poet.Nickname,
|
||||
Published = poet.Published,
|
||||
ImageUrl = poet.RImageId == null ? "" : $"/api/rimages/{poet.RImageId}.jpg"
|
||||
}
|
||||
)
|
||||
.ToListAsync();
|
||||
@ -258,7 +261,10 @@ namespace RMuseum.Services.Implementation
|
||||
Name = p.Name,
|
||||
Description = p.Description,
|
||||
FullUrl = _context.GanjoorCategories.Where(c => c.PoetId == p.Id && c.ParentId == null).Single().FullUrl,
|
||||
RootCatId = _context.GanjoorCategories.Where(c => c.PoetId == p.Id && c.ParentId == null).Single().Id
|
||||
RootCatId = _context.GanjoorCategories.Where(c => c.PoetId == p.Id && c.ParentId == null).Single().Id,
|
||||
Nickname = p.Nickname,
|
||||
Published = p.Published,
|
||||
ImageUrl = p.RImageId == null ? "" : $"/api/rimages/{p.RImageId}.jpg"
|
||||
}).FirstOrDefaultAsync(),
|
||||
Cat = catViewModel
|
||||
}
|
||||
@ -327,7 +333,10 @@ namespace RMuseum.Services.Implementation
|
||||
Id = poet.Id,
|
||||
Name = poet.Name,
|
||||
FullUrl = cat.FullUrl,
|
||||
RootCatId = cat.Id
|
||||
RootCatId = cat.Id,
|
||||
Nickname = poet.Nickname,
|
||||
Published = poet.Published,
|
||||
ImageUrl = poet.RImageId == null ? "" : $"/api/rimages/{poet.RImageId}.jpg"
|
||||
}
|
||||
)
|
||||
.SingleAsync();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user