johannesa
johannesa
CC#
Created by johannesa on 4/8/2024 in #help
✅ Hello!
alright thanks alot for your help 🙂
14 replies
CC#
Created by johannesa on 4/8/2024 in #help
✅ Hello!
But okay so the DBset alrdy acts as a repo, so the service talks directly to Ef then
14 replies
CC#
Created by johannesa on 4/8/2024 in #help
✅ Hello!
Yes its entityframework core, I will be using SqlLite for now but later i might use server instead.
14 replies
CC#
Created by johannesa on 4/8/2024 in #help
✅ Hello!
Right now its just writing the that an error occured to the console. But i read something about an logger i could use later
14 replies
CC#
Created by johannesa on 4/8/2024 in #help
✅ Hello!
public async Task AddAsync(Product product) { try { await storeContext.AddAsync(product); await storeContext.SaveChangesAsync(); } catch (Exception ex) { Console.WriteLine(@$"Ett fel inträffade, vid försök av att lägga till en entity i databasen. {ex.Message}"); } }
14 replies
CC#
Created by johannesa on 4/8/2024 in #help
✅ Hello!
Is this a good approach? This is the add method in the repo
14 replies
CC#
Created by johannesa on 4/8/2024 in #help
✅ Hello!
OKay thank you!
14 replies