Cydo
Cydo
Explore posts from servers
CC#
Created by Cydo on 10/25/2024 in #help
✅ When should you or shouldnt you return nested data in an api call?
Nvm think I figured out the answer and I should use projections to go over the returned data and structuring it how I want before mapping it to a dto and sending it the client
13 replies
CC#
Created by Cydo on 10/25/2024 in #help
✅ When should you or shouldnt you return nested data in an api call?
Perfect so this is what I'm trying to do, structure my apis to match the front end i already built out. However my next question is if ur fetching the data from the database for something like a task and it's comments, should u get the single task and all of its comments and then loop over the comments up to say 5 and then send the 5 comments back in the json response to the client. and then have a seperate end point thats just gonna keep fetching the paginated comments for that task or instead do 2 separate api calls from the start, one for the task, and the other just getting the 5 comments for that task and then creating the json response object, and have them load independently on the front end, and then every time u wanna get the next page of comments u already have that getPaginatedComments endpoint to call
13 replies
CC#
Created by Cydo on 9/19/2024 in #help
✅ How should updating Database work with Kanban style app work?
yeah def not that LOL, i am very much just trying to build a somewhat impressive portfolio project to hopefully get a job at a .NET shop lol, only been learning .NET and C# for about 30 days now 😅
7 replies
CC#
Created by Cydo on 9/19/2024 in #help
✅ How should updating Database work with Kanban style app work?
Or really, I thought moving the cards and updating them every time would cause some kind of performance issues, but if thats not the case then this is great news 😄
7 replies
CC#
Created by Cydo on 9/16/2024 in #help
✅ Having trouble handling errors when registering a new user
Alright ill do that thanks.
6 replies
CC#
Created by Cydo on 9/16/2024 in #help
✅ Having trouble handling errors when registering a new user
So instead pass something like ErrorCodes.InvalidEmailFormat, and then on the front end have a look up table that will look for that error code and have the custom error message like "Email must in the correct format"
6 replies
CC#
Created by Cydo on 9/16/2024 in #help
✅ Having trouble handling errors when registering a new user
I think I might have come up with a viable solution where I create a my own exception and then deliberately check for the error message and throw that error
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Questlog.Application.Common.Exceptions
{
public class InvalidEmailFormatException : Exception
{
public Dictionary<string, List<string>> Errors { get; }
public InvalidEmailFormatException(Dictionary<string, List<string>> errors)
: base("Incorrect Email Format")
{
Errors = errors;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Questlog.Application.Common.Exceptions
{
public class InvalidEmailFormatException : Exception
{
public Dictionary<string, List<string>> Errors { get; }
public InvalidEmailFormatException(Dictionary<string, List<string>> errors)
: base("Incorrect Email Format")
{
Errors = errors;
}
}
}
var result = await _userManager.CreateAsync(user, registerRequestDTO.Password);

if (result.Succeeded)
{
var loginRequestDTO = new LoginRequestDTO
{
Email = registerRequestDTO.Email,
Password = registerRequestDTO.Password,

};

return await Login(loginRequestDTO);
}
else
{
var errors = new Dictionary<string, List<string>>();
foreach (var error in result.Errors)
{
if (error.Code.Contains("UserName"))
{
errors.Add("Email", new List<string> { error.Description });
}
}

throw new InvalidEmailFormatException(errors);

//var errors = string.Join(", ", result.Errors.Select(e => e.Description));
//throw new InvalidOperationException(errors);
}
var result = await _userManager.CreateAsync(user, registerRequestDTO.Password);

if (result.Succeeded)
{
var loginRequestDTO = new LoginRequestDTO
{
Email = registerRequestDTO.Email,
Password = registerRequestDTO.Password,

};

return await Login(loginRequestDTO);
}
else
{
var errors = new Dictionary<string, List<string>>();
foreach (var error in result.Errors)
{
if (error.Code.Contains("UserName"))
{
errors.Add("Email", new List<string> { error.Description });
}
}

throw new InvalidEmailFormatException(errors);

//var errors = string.Join(", ", result.Errors.Select(e => e.Description));
//throw new InvalidOperationException(errors);
}
I am all ears if there is a better solution then this though
6 replies
CC#
Created by Cydo on 9/14/2024 in #help
✅ How to hide sensitive data, like database credentials api keys etc
I should of kept reading, my apologies I am dumb
16 replies
CC#
Created by Cydo on 9/14/2024 in #help
✅ How to hide sensitive data, like database credentials api keys etc
Ok now this is a real dumb question, inside of visual studio theres no terminal like vs code, u have this package manager console and then the developer terminal, is that going to the same thing as using windows terminal?
16 replies
CC#
Created by Cydo on 9/14/2024 in #help
✅ How to hide sensitive data, like database credentials api keys etc
I think ill opt for that when I get this project completed, im just trying to spruce up my resume and get some interviews lol.
16 replies
CC#
Created by Cydo on 9/14/2024 in #help
✅ How to hide sensitive data, like database credentials api keys etc
No description
16 replies
CC#
Created by Cydo on 9/14/2024 in #help
✅ How to hide sensitive data, like database credentials api keys etc
yeah, aws at least had a 1 year free tier when i learned that for node and react, i just terminated my account at the 1 year mark tho lol
16 replies
CC#
Created by Cydo on 9/14/2024 in #help
✅ How to hide sensitive data, like database credentials api keys etc
But the rest will? My fear is I make a little portfolio app host it for 5$ or w.e the lowest fee is on azure and them somehow i get a bill that is thousands of dollars with out knowing how that even happened lol
16 replies
CC#
Created by Cydo on 9/6/2024 in #help
✅ What is considered enough knowledge to start applying?
Ive been learning .NET 8, so ive only touched modern .NET, DI seemed similar to Spring Boot which I did in college so that wasnt too crazy to pick up
25 replies
CC#
Created by Cydo on 9/6/2024 in #help
✅ What is considered enough knowledge to start applying?
is OTEL .NET observability with OpenTelemetry?
25 replies
CC#
Created by Cydo on 9/6/2024 in #help
✅ What is considered enough knowledge to start applying?
What about the language overall? I understand fundamentals, and OOP, but then C# has multithreading, async await, delegates, projects, assemblies, solutions, and then theres other topics such as Unit Testing, Deployment, CI/CD etc, is a junior not expected to know that, but it would be nice to haves? My background is prodominantly javascript, react and node js. I can build full stack applications and deploy them. .Net and C# just feel like a different world compared.
25 replies
CC#
Created by Cydo on 8/27/2024 in #help
✅ Why Red Underline on Views?
it was resharper that was causing the problem, thanks for suggestions.
15 replies
CC#
Created by Cydo on 8/18/2024 in #help
✅ MVC application routing issue.
yes, the tag helpers were the issue all the time, thanks for helping me so much, been at this since 9am lol, and its now 5pm xD
54 replies
CC#
Created by Cydo on 8/18/2024 in #help
✅ MVC application routing issue.
hopefully this fixes my issue on why my add to cart page, saves 0 to my database no matter what number i put in the input as well
54 replies
CC#
Created by Cydo on 8/18/2024 in #help
✅ MVC application routing issue.
No description
54 replies