İrşat
❔ .NET 7 in Cpanel
Does Plesk 10 support .NET 7? Probably not.
Can I use
dotnet publish
as linux and use Cpanel?
(context: I bought a hosting with all the ssl, domain in it for a nice price. The saleswoman said yes it supports .NET 7. I noticed it only has Plesk 10, Cpanel and DirectAdmin smh)2 replies
❔ .NET 7 + React deployment concept?
I am having a hard time understanding the google cloud deployment method. Let's say I created an app with
dotnet new react
, now I have an API and inside the folder there is ClientApp. I need a docker image too. But here is the part I have no idea about;
How do I deploy them together? Or do I host them seperately? How can I have them both in the same url? Do I need docker image for react app? It's bundled so I don't think I need one. If yes, both of them get the same image? So many questions, I just need to understand the concept.
edit: dotnet publish --os linux --arch x64 -p:PublishProfile=DefaultContainer
& npm run build
I also used these. I just saw ClientApp as wwwroot inside bin/../publish3 replies
❔ how to use Docker for 2 apps in a project
-They both require .NET 6.0.404 and Entity Framework.
-I use VS CODE.
-WebApp and WebApi have different packages inside them. Afaik they are inside the projects so they don't require a reference in the Docker Image, correct me if I am wrong.
-I use Git. Not sure if it affects.
So where do I start creating an image? (+ should I use docker in the development process?)
3 replies
✅ EF two Select in a query problem when using ToList().
I want to reduce two ToList() to one. But it gives me error.
System.InvalidOperationException: The LINQ expression 'ProjectionBindingExpression: 0' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.
27 replies
✅ Upgrading Javascript to Typescript in MVC project
I globally installed npm and typescript. Then created a tsconfig.json in my project. But I have no idea what to do after that.
I am trying to put my .ts files in TypeScript folder directly under the App.Web. Both TypeScript folder and tsconfig.json are right under App.Web.
(I have 2 apps in one project. App.Web and App.Api)
Installing typescript in App.Web was a torture. I gave up and installed it globally.
41 replies
Calculating post contents without fetching
This alone takes more than 100ms. I wonder if it's optimized. With the rest, it's around 150-200ms. There are barelly any text in chapters and comments. So I am confused why it's that long.
I tested by commenting the counting reply. It's the one with 100ms.
3 replies
Creating a return to page button
I have a post info page and posts page. Now posts page can have many filters, page number and stuff, I don't want to lose them. Just like when I click the built-in previous page icon, it should return to the posts page.
I need to go back to the posts page with a custom button because I can go further deep and return to post info page which renders built-in back icon useless.
The problem is how will I store this posts url information. It's harder because I can return to post info page from the post's chapters.
2 replies
Environmental Variables in VS 2022 [Answered]
I am trying to get those environmental variables and write them here;
I realized that VS 2022 doesn't support this. So I experimented and used windows environmental variables instead. Mission accomplished unsuccessfully.
It finally shows something else than just C:\Debug. It doesn't work regardless. How do I do this normally? Oh and it would be nice if I could reach this damn thing from the entire project. There is one main project and some dependencies. All uses these.
2 replies
HttpRequestException Error Handling
It says the target actively refused it. It's because I didn't launch my API. Therefore it cannot request something and gives me this error.
If we put try catch aside for a minute, is there a nice way to just skip these codes if it refuses? I will send empty lists to the client and just say "Sorry, we are having some technical issues." or something.
14 replies
Check if user already voted this post or comment [Answered]
I want to fill the like/dislike buttons with color if they are already voted by the user. Which one would be faster and more economic;
-Fetching the votes of the parent post/comment from the start, then checking if this user's id is there or...
-Another request to the api to check if user has a record already with that post's id in votes table.
54 replies
EF sets a property out of nowhere [Solved] [Answered]
I have a model with this constructor. Basically, I get the amount of replies which are not deleted through Count. Total is 5 and 3 of them are not deleted.
Literally the same codes. But at the end, RepliesCount returns 5 and RepliesLength returns 3. RepliesLength can have any name. But when I use the name "RepliesCount", it fetches all the replies.
I used breakpoints to see where it comes from since I didn't reference to it anywhere. It starts filling properties, assigns 3 to both, as one would expect. But after filling others properties, for some reason it jumps to setter and assigns 5 to RepliesCount.
My theory; EF can fill the Replies if I want. Perhaps if I write the "Replies" then add "Count" at the end, it automatically runs the Count function and assigns to it? Because I didn't reference it anywhere.
58 replies