Whiteboy
Whiteboy
CC#
Created by Whiteboy on 2/10/2025 in #help
✅ 2 Databases Identity.ef + my CustomDb FK INSERT issue
Just had to make one DbContext
28 replies
CC#
Created by Whiteboy on 2/10/2025 in #help
✅ 2 Databases Identity.ef + my CustomDb FK INSERT issue
So after fixing 91234812 (maybe more) other problems it works just fine with one db. My code for services was ok.
28 replies
CC#
Created by Whiteboy on 2/10/2025 in #help
✅ 2 Databases Identity.ef + my CustomDb FK INSERT issue
okay thanks, will update here if all works
28 replies
CC#
Created by Whiteboy on 2/10/2025 in #help
✅ 2 Databases Identity.ef + my CustomDb FK INSERT issue
ye when i register the user data is only in UsersDb, and not in TodoListDb even tho it creates a table for user
28 replies
CC#
Created by Whiteboy on 2/10/2025 in #help
✅ 2 Databases Identity.ef + my CustomDb FK INSERT issue
so i just merge it all to one db and should be fine?
28 replies
CC#
Created by Whiteboy on 2/10/2025 in #help
✅ 2 Databases Identity.ef + my CustomDb FK INSERT issue
ye at first i was really confused to use 2 dbs
28 replies
CC#
Created by Whiteboy on 2/10/2025 in #help
✅ 2 Databases Identity.ef + my CustomDb FK INSERT issue
Oh
28 replies
CC#
Created by Whiteboy on 2/10/2025 in #help
✅ 2 Databases Identity.ef + my CustomDb FK INSERT issue
and then i made 2nd db for actual entities
28 replies
CC#
Created by Whiteboy on 2/10/2025 in #help
✅ 2 Databases Identity.ef + my CustomDb FK INSERT issue
it was the requrement to use Identity.entityFramework to make register/login
28 replies
CC#
Created by Whiteboy on 2/10/2025 in #help
✅ 2 Databases Identity.ef + my CustomDb FK INSERT issue
why is there dbo.Applicationuser in my TodoListDb, am i not refferencing the UsersDb correctly somewhere?
28 replies
CC#
Created by Whiteboy on 2/10/2025 in #help
✅ 2 Databases Identity.ef + my CustomDb FK INSERT issue
So after further investigation i am even more confused
28 replies
CC#
Created by Whiteboy on 2/10/2025 in #help
✅ 2 Databases Identity.ef + my CustomDb FK INSERT issue
but TodoListUsers table is all null
28 replies
CC#
Created by Whiteboy on 2/10/2025 in #help
✅ 2 Databases Identity.ef + my CustomDb FK INSERT issue
so i checked TodoLists table and looks fine
28 replies
CC#
Created by Whiteboy on 2/10/2025 in #help
✅ 2 Databases Identity.ef + my CustomDb FK INSERT issue
looks the same to me
28 replies
CC#
Created by Whiteboy on 2/10/2025 in #help
✅ 2 Databases Identity.ef + my CustomDb FK INSERT issue
No description
28 replies
CC#
Created by Whiteboy on 2/10/2025 in #help
✅ 2 Databases Identity.ef + my CustomDb FK INSERT issue
So im checking this because in DTO i added extra field that tdoes nothing, i will remove it and see
28 replies
CC#
Created by Whiteboy on 2/10/2025 in #help
✅ 2 Databases Identity.ef + my CustomDb FK INSERT issue
public async Task<TodoListUserDto> CreateAsync(TodoListUserDto dto)
{
var todoListUser = new TodoListUser
{
TodoListId = dto.TodoListId,
UserId = dto.UserId,
Role = TodoListRole.Owner
};

this.todoListDbContext.TodoListUsers.Add(todoListUser);
await this.todoListDbContext.SaveChangesAsync();

return new TodoListUserDto
{
TodoListId = todoListUser.TodoListId,
UserId = todoListUser.UserId,
UserName = todoListUser.User.UserName!,
Role = todoListUser.Role
};
}
public async Task<TodoListUserDto> CreateAsync(TodoListUserDto dto)
{
var todoListUser = new TodoListUser
{
TodoListId = dto.TodoListId,
UserId = dto.UserId,
Role = TodoListRole.Owner
};

this.todoListDbContext.TodoListUsers.Add(todoListUser);
await this.todoListDbContext.SaveChangesAsync();

return new TodoListUserDto
{
TodoListId = todoListUser.TodoListId,
UserId = todoListUser.UserId,
UserName = todoListUser.User.UserName!,
Role = todoListUser.Role
};
}
28 replies
CC#
Created by Whiteboy on 2/9/2025 in #help
✅ Connect WebApp to API ??
okay, with https profile on port 5001 it works, thanks
4 replies
CC#
Created by Whiteboy on 12/11/2024 in #help
✅ Testing an abstract class
Yes, i did just that, but the task was meant not to modify test so idk what will happen, scored 94% tough
7 replies