linqisnice
linqisnice
CC#
Created by linqisnice on 5/4/2024 in #help
Hangfire out of memory exception crashing our app services. Anyone got any advice?
@SpReeD
5 replies
CC#
Created by linqisnice on 5/4/2024 in #help
Hangfire out of memory exception crashing our app services. Anyone got any advice?
So, hangfire serializes methods and persists them to the db, polls the db and then a worker deserializes a method argument and invokes the method. Either reading from the db or deserialization fails due to the size of the data, that much seems evident from the image above. But how do I even begin to troubleshoot it? Because it doesnt make sense to me, the db has no mroe jobs left
5 replies
CC#
Created by Mrguy235 on 4/17/2024 in #help
ASP MVC Inventory management checkout process help
i.e. not thinking through your data structures and how they will affect the way you write your code
252 replies
CC#
Created by Mrguy235 on 4/17/2024 in #help
ASP MVC Inventory management checkout process help
most problems originate from bad data structures
252 replies
CC#
Created by Mrguy235 on 4/17/2024 in #help
ASP MVC Inventory management checkout process help
if refactoring will improve your code, you should refactor
252 replies
CC#
Created by Mrguy235 on 4/17/2024 in #help
ASP MVC Inventory management checkout process help
you shouldnt hold on to it like its holy
252 replies
CC#
Created by Mrguy235 on 4/17/2024 in #help
ASP MVC Inventory management checkout process help
well, sometimes you need to change your code
252 replies
CC#
Created by Mrguy235 on 4/17/2024 in #help
ASP MVC Inventory management checkout process help
you already have a cartitem, but move the quantity into it
252 replies
CC#
Created by Mrguy235 on 4/17/2024 in #help
ASP MVC Inventory management checkout process help
Or should and should, thats what id do at least
252 replies
CC#
Created by Mrguy235 on 4/17/2024 in #help
ASP MVC Inventory management checkout process help
No, sorry. You should create a CartItem class that has the item id and orderquantity int
252 replies
CC#
Created by Mrguy235 on 4/17/2024 in #help
ASP MVC Inventory management checkout process help
Id just have quantity as a primitive (int) rather than a dedicated class
252 replies
CC#
Created by Mrguy235 on 4/17/2024 in #help
ASP MVC Inventory management checkout process help
ah ok, anyway dont fret about things taking time. they always do, and you will get better
252 replies
CC#
Created by Mrguy235 on 4/17/2024 in #help
ASP MVC Inventory management checkout process help
alright, but my point still stands, id use iservicescopefactory to resolve dbcontext in a singleton rather than dbcontextfactory
252 replies
CC#
Created by Mrguy235 on 4/17/2024 in #help
ASP MVC Inventory management checkout process help
you shouldnt do that
252 replies
CC#
Created by Mrguy235 on 4/17/2024 in #help
ASP MVC Inventory management checkout process help
Wait you are registering dbcontext as a singleton?
252 replies
CC#
Created by Mrguy235 on 4/17/2024 in #help
ASP MVC Inventory management checkout process help
How?
252 replies
CC#
Created by Mrguy235 on 4/17/2024 in #help
ASP MVC Inventory management checkout process help
Don't think you can use DbContextFactory along with DbContext registered as scoped because it will select the first one that is registered. You can work around this ,but should probably use IServiceScopeFactory to resolve scoped services in a singleton to avoid captive dependecy
252 replies
CC#
Created by restingphantom on 4/12/2024 in #help
✅ Seed cannot be added because of required property ID
or do you mean hes looking directly in the database?
121 replies
CC#
Created by restingphantom on 4/12/2024 in #help
✅ Seed cannot be added because of required property ID
but surely hes fetching from the database? u can convert upon fetching
121 replies
CC#
Created by restingphantom on 4/12/2024 in #help
✅ Seed cannot be added because of required property ID
why would you convert in the database?
121 replies