-
Notifications
You must be signed in to change notification settings - Fork 518
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #372 from KhanbalaRashidov/main
Code refactor
- Loading branch information
Showing
7 changed files
with
14 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,6 @@ | ||
namespace Blogifier.Shared; | ||
|
||
public class CategoryModel : PostPagerModel | ||
public class CategoryModel(string category, PostPagerDto pager, MainDto main) : PostPagerModel(pager, main) | ||
{ | ||
public string Category { get; set; } | ||
|
||
public CategoryModel(string category, PostPagerDto pager, MainDto main) : base(pager, main) | ||
{ | ||
Category = category; | ||
} | ||
public string Category { get; set; } = category; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
using Blogifier.Shared; | ||
namespace Blogifier.Models; | ||
|
||
public class IndexModel : PostPagerModel | ||
public class IndexModel(PostPagerDto pager, MainDto main) : PostPagerModel(pager, main) | ||
{ | ||
public IndexModel(PostPagerDto pager, MainDto main) : base(pager, main) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,6 @@ | ||
namespace Blogifier.Shared; | ||
|
||
public class MainModel | ||
public class MainModel(MainDto main) | ||
{ | ||
public MainDto Main { get; set; } | ||
|
||
public MainModel(MainDto main) | ||
{ | ||
Main = main; | ||
} | ||
public MainDto Main { get; set; } = main; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,7 @@ | ||
namespace Blogifier.Shared; | ||
|
||
public class PostModel : MainModel | ||
public class PostModel(PostSlugDto postSlug, string categoriesUrl, MainDto main) : MainModel(main) | ||
{ | ||
public PostModel(PostSlugDto postSlug, string categoriesUrl, MainDto main) : base(main) | ||
{ | ||
PostSlug = postSlug; | ||
CategoriesUrl = categoriesUrl; | ||
} | ||
public PostSlugDto PostSlug { get; set; } | ||
public string CategoriesUrl { get; set; } | ||
public PostSlugDto PostSlug { get; set; } = postSlug; | ||
public string CategoriesUrl { get; set; } = categoriesUrl; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
namespace Blogifier.Shared; | ||
|
||
public class PostPagerModel : MainModel | ||
public class PostPagerModel(PostPagerDto pager, MainDto main) : MainModel(main) | ||
{ | ||
public PostPagerModel(PostPagerDto pager, MainDto main) : base(main) | ||
{ | ||
Pager = pager; | ||
} | ||
public PostPagerDto Pager { get; } | ||
public PostPagerDto Pager { get; } = pager; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
namespace Blogifier.Shared; | ||
|
||
public class SearchModel : PostPagerModel | ||
public class SearchModel(PostPagerDto pager, MainDto main) : PostPagerModel(pager, main) | ||
{ | ||
public SearchModel(PostPagerDto pager, MainDto main) : base(pager, main) | ||
{ | ||
} | ||
} |