Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
fb33b95
for images
JavlonAlimov Aug 5, 2024
4a613ea
Merge branch 'DevelopingBranch' of https://github.com/C-sharp-Qirolli…
JavlonAlimov Aug 5, 2024
4ffb8e8
Merge branch 'DevelopingBranch' of https://github.com/C-sharp-Qirolli…
JavlonAlimov Aug 5, 2024
322b602
Merge branch 'DevelopingBranch' of https://github.com/C-sharp-Qirolli…
JavlonAlimov Aug 5, 2024
16f67fb
Merge pull request #25 from C-sharp-Qirolligi/muhammad0805-1
MuhammadMangitov Aug 6, 2024
c334add
user image
JavlonAlimov Aug 6, 2024
6feb012
user images
JavlonAlimov Aug 7, 2024
3e7d762
finished upload Images
JavlonAlimov Aug 8, 2024
4baec63
Merge branch 'DevelopingBranch' into For-Files
Javlon-Alimov Aug 8, 2024
cdabc59
Merge pull request #27 from JavlonAlimov/For-Files
FirdavsAX Aug 8, 2024
d88501d
Fixed Gigant Meta BUg with changeing tables and Services
FirdavsAX Aug 9, 2024
7b18164
Merge pull request #30 from C-sharp-Qirolligi/Firdavs2
FirdavsAX Aug 9, 2024
8fdf4b1
Merge branch 'DangerBranch' into DevelopingBranch
FirdavsAX Aug 9, 2024
f04427b
Merge pull request #31 from C-sharp-Qirolligi/DevelopingBranch
FirdavsAX Aug 9, 2024
87f7513
To Megring and reolve comfilcts
FirdavsAX Aug 9, 2024
1ec18ac
Merge pull request #32 from C-sharp-Qirolligi/Firdavs2
FirdavsAX Aug 9, 2024
f320cf0
editing some bugs
FirdavsAX Aug 9, 2024
9216c3e
Edited bugs in QuestionController
FirdavsAX Aug 9, 2024
81fea33
Merge branch 'DangerBranch' of https://github.com/C-sharp-Qirolligi/S…
FirdavsAX Aug 9, 2024
a60de55
Fixed all bugs and Api is work little correctly
FirdavsAX Aug 9, 2024
f25c32c
Editing something
FirdavsAX Aug 10, 2024
6ba35eb
editing questionController something
FirdavsAX Aug 11, 2024
e469cea
asd
MuhammadMangitov Aug 12, 2024
3010931
ert
MuhammadMangitov Aug 12, 2024
b312130
wewe
MuhammadMangitov Aug 15, 2024
f410efa
Added Send Notification service and controller
FirdavsAX Aug 15, 2024
3a7acca
Editing image uploading and Downloading
FirdavsAX Aug 16, 2024
0d69772
Add some changes in store images and send
FirdavsAX Aug 17, 2024
469feb7
changed and fixed all image save and send logics
FirdavsAX Aug 17, 2024
cbd84e3
adding some cahnges
FirdavsAX Aug 17, 2024
f005138
edited controller endpoint
FirdavsAX Aug 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions SQLQuery1.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
delete from Comments ;
10 changes: 5 additions & 5 deletions SciQuery.Domain/Entities/Answer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ namespace SciQuery.Domain.Entities;
public class Answer
{
public int Id { get; set; }
public string? Body { get; set; }
public int Votes { get; set; } = 0;
public List<string?>? ImagePaths { get; set; }
public DateTime CreatedDate { get; set; } = DateTime.Now;
public DateTime? UpdatedDate { get; set; } = DateTime.Now;
public int QuestionId { get; set; }
public Question Question { get; set; }
public string UserId { get; set; }
public User User { get; set; }
public string? Body { get; set; }
public List<string?>? ImagePath { get; set; }
public DateTime CreatedDate { get; set; } = DateTime.Now;
public DateTime? UpdatedDate { get; set; } = DateTime.Now;

public virtual ICollection<Vote> Votes { get; set; }
public virtual ICollection<Comment> Comments{ get; set; }


Expand Down
6 changes: 2 additions & 4 deletions SciQuery.Domain/Entities/Comment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ public class Comment
public int Id { get; set; }
public string UserId { get; set; }
public User User { get; set; }
public int? QuestionId { get; set; }
public Question Question { get; set; }
public int? AnswerId { get; set; }
public Answer Answer { get; set; }
public int PostId { get; set; }
public PostType Post{ get; set; }
public string Body { get; set; }
public DateTime CreatedDate { get; set; } = DateTime.Now;
}
7 changes: 7 additions & 0 deletions SciQuery.Domain/Entities/PostType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace SciQuery.Domain.Entities;

public enum PostType
{
Answer,
Question
}
11 changes: 6 additions & 5 deletions SciQuery.Domain/Entities/Question.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,20 @@ namespace SciQuery.Domain.Entities;
public class Question
{
public int Id { get; set; }
public string UserId { get; set; }
public User User { get; set; }
public string? Title { get; set; }
public string? Body { get; set; }
public List<string?>? ImagePath { get; set; }
public int Votes { get; set; } = 0;
public List<string>? ImagePaths { get; set; }
public DateTime CreatedDate { get; set; } = DateTime.Now;
public DateTime? UpdatedDate { get; set; }
public DateTime? UpdatedDate { get; set; } = DateTime.Now;
public string UserId { get; set; }
public User User { get; set; }
public virtual ICollection<Answer> Answers { get; set; }
public virtual ICollection<Comment> Comments { get; set; }
public virtual ICollection<QuestionTag> QuestionTags { get; set; }
public virtual ICollection<Vote> Votes { get; set; }
public Question()
{
ImagePaths = new List<string>();
Answers = new List<Answer>();
Comments = new List<Comment>();
QuestionTags = new List<QuestionTag>();
Expand Down
17 changes: 0 additions & 17 deletions SciQuery.Domain/Entities/Vote.cs

This file was deleted.

1 change: 1 addition & 0 deletions SciQuery.Domain/SciQuery.Domain.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.7" />
<PackageReference Include="Microsoft.AspNetCore.SignalR" Version="1.1.0" />
</ItemGroup>

</Project>
10 changes: 10 additions & 0 deletions SciQuery.Domain/UserModels/User.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Identity;
using SciQuery.Domain.Entities;
using System.Globalization;

namespace SciQuery.Domain.UserModels;
Expand All @@ -9,4 +10,13 @@ public class User : IdentityUser
public int Reputation { get; set; }
public DateTime CreatedDate { get; set; }
public DateTime LastLogindate { get; set; }
public virtual ICollection<Answer> Answers{ get; set; }
public virtual ICollection<Question> Questions{ get; set; }
public virtual ICollection<Comment> Comments{ get; set; }
public User()
{
Answers = new List<Answer>();
Questions = new List<Question>();
Comments = new List<Comment>();
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace SciQuery.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class Intial_Create : Migration
public partial class _1 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
Expand Down Expand Up @@ -276,33 +276,35 @@ protected override void Up(MigrationBuilder migrationBuilder)
});

migrationBuilder.CreateTable(
name: "Comment",
name: "Comments",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
UserId = table.Column<string>(type: "nvarchar(450)", nullable: false),
QuestionId = table.Column<int>(type: "int", nullable: true),
AnswerId = table.Column<int>(type: "int", nullable: true),
PostId = table.Column<int>(type: "int", nullable: false),
Post = table.Column<int>(type: "int", nullable: false),
Body = table.Column<string>(type: "nvarchar(max)", nullable: false),
CreatedDate = table.Column<DateTime>(type: "datetime2", nullable: false)
CreatedDate = table.Column<DateTime>(type: "datetime2", nullable: false),
AnswerId = table.Column<int>(type: "int", nullable: true),
QuestionId = table.Column<int>(type: "int", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Comment", x => x.Id);
table.PrimaryKey("PK_Comments", x => x.Id);
table.ForeignKey(
name: "FK_Comment_Answer_AnswerId",
name: "FK_Comments_Answer_AnswerId",
column: x => x.AnswerId,
principalTable: "Answer",
principalColumn: "Id");
table.ForeignKey(
name: "FK_Comment_AspNetUsers_UserId",
name: "FK_Comments_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Comment_Question_QuestionId",
name: "FK_Comments_Question_QuestionId",
column: x => x.QuestionId,
principalTable: "Question",
principalColumn: "Id");
Expand All @@ -315,9 +317,11 @@ protected override void Up(MigrationBuilder migrationBuilder)
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
UserId = table.Column<string>(type: "nvarchar(450)", nullable: false),
QuestionId = table.Column<int>(type: "int", nullable: true),
PostId = table.Column<int>(type: "int", nullable: false),
Post = table.Column<int>(type: "int", nullable: false),
VoteType = table.Column<int>(type: "int", nullable: false),
AnswerId = table.Column<int>(type: "int", nullable: true),
VoteType = table.Column<int>(type: "int", nullable: false)
QuestionId = table.Column<int>(type: "int", nullable: true)
},
constraints: table =>
{
Expand Down Expand Up @@ -390,18 +394,18 @@ protected override void Up(MigrationBuilder migrationBuilder)
filter: "[NormalizedUserName] IS NOT NULL");

migrationBuilder.CreateIndex(
name: "IX_Comment_AnswerId",
table: "Comment",
name: "IX_Comments_AnswerId",
table: "Comments",
column: "AnswerId");

migrationBuilder.CreateIndex(
name: "IX_Comment_QuestionId",
table: "Comment",
name: "IX_Comments_QuestionId",
table: "Comments",
column: "QuestionId");

migrationBuilder.CreateIndex(
name: "IX_Comment_UserId",
table: "Comment",
name: "IX_Comments_UserId",
table: "Comments",
column: "UserId");

migrationBuilder.CreateIndex(
Expand Down Expand Up @@ -459,7 +463,7 @@ protected override void Down(MigrationBuilder migrationBuilder)
name: "AspNetUserTokens");

migrationBuilder.DropTable(
name: "Comment");
name: "Comments");

migrationBuilder.DropTable(
name: "QuestionTag");
Expand Down
Loading