Mastervoliumpl
Mastervoliumpl
CC#
Created by Mastervoliumpl on 9/1/2024 in #help
Add an object to list
Lmao
162 replies
CC#
Created by Mastervoliumpl on 9/1/2024 in #help
Add an object to list
Today I relized that I completely misunderstood inheritance and that I did not need all the properties in Blogpost or Portfolio
162 replies
CC#
Created by Mastervoliumpl on 9/1/2024 in #help
Add an object to list
-------------------- Also, I will be heading of for today. Currently it's 00:17 lol. I really appreciate the help, thank you. I will look through this and see what I can implement and think through some of this stuff. Will probably come back tomorrow for some questions if no one minds. 🙂
162 replies
CC#
Created by Mastervoliumpl on 9/1/2024 in #help
Add an object to list
Well see, heres the issue. We haven't gotten to databases yet (as in how to use them with code). And we haven't gotten to Razorpages yet, which is how you would interact with this website. I'm meant to make the backend and have it work. I guess I could add something simple like saving things in a csv or something. Then later exchange the things for a database. But until then it's not or requirment/need. As for requirements, there isn't any requirements regarding what NEEDs to be included feature wise. But what the teacher will be looking at is the interfaces, repositories and model classes. And obviously what would be needed for a blogpost and portfolio to work.
162 replies
CC#
Created by Mastervoliumpl on 9/1/2024 in #help
Add an object to list
(School)
162 replies
CC#
Created by Mastervoliumpl on 9/1/2024 in #help
Add an object to list
Yes
162 replies
CC#
Created by Mastervoliumpl on 9/1/2024 in #help
Add an object to list
I'm guessing you mean PostRepo and BlogPostRepo?
162 replies
CC#
Created by Mastervoliumpl on 9/1/2024 in #help
Add an object to list
Repositories? I have 5 currently.
162 replies
CC#
Created by Mastervoliumpl on 9/1/2024 in #help
Add an object to list
Yeah, until I get to add an actual database, this is what I have to do.
162 replies
CC#
Created by Mastervoliumpl on 9/1/2024 in #help
Add an object to list
Then through the interfaces use the methods
162 replies
CC#
Created by Mastervoliumpl on 9/1/2024 in #help
Add an object to list
So instead of having methods in the model classes where one would be able to access it, you instead do that in the repo.
162 replies
CC#
Created by Mastervoliumpl on 9/1/2024 in #help
Add an object to list
And the way I understood Reposetories is that it's basically where you want all your buissness logic. (Methods)
162 replies
CC#
Created by Mastervoliumpl on 9/1/2024 in #help
Add an object to list
E.g Author does not have any methods. (At least currently)
162 replies
CC#
Created by Mastervoliumpl on 9/1/2024 in #help
Add an object to list
As in has methods
162 replies
CC#
Created by Mastervoliumpl on 9/1/2024 in #help
Add an object to list
I have a Repo for each Model class that needs it.
162 replies
CC#
Created by Mastervoliumpl on 9/1/2024 in #help
Add an object to list
Yeah, CreateBlogPost. Haven't done the interface thing you advised me to do yet.
162 replies
CC#
Created by Mastervoliumpl on 9/1/2024 in #help
Add an object to list
Is it because I'm converting from BlogPost to Post?
162 replies
CC#
Created by Mastervoliumpl on 9/1/2024 in #help
Add an object to list
Before this it wouldn't add the created blogpost to the list
162 replies
CC#
Created by Mastervoliumpl on 9/1/2024 in #help
Add an object to list
I figured it out by adding this into BlogPostRepo:
C#
private readonly IPostRepo _postRepo; // <--- This part

public void CreateBlogPost(Author author, string title, string bodyText)
{
// Create a new BlogPost
BlogPost blogPost = new BlogPost(title, author, bodyText);
_postRepo.AddPost(blogPost); // <--- And this
}
C#
private readonly IPostRepo _postRepo; // <--- This part

public void CreateBlogPost(Author author, string title, string bodyText)
{
// Create a new BlogPost
BlogPost blogPost = new BlogPost(title, author, bodyText);
_postRepo.AddPost(blogPost); // <--- And this
}
162 replies
CC#
Created by Mastervoliumpl on 9/1/2024 in #help
Add an object to list
Which one 😂
162 replies