SWEETPONY
✅ is there any way to delete items from the database and return the deleted list in one request?
is there any way to delete items from the database and return the deleted list in one request?
I can do something like this:
DbContext.T.Where(entity => ..).ExecuteDelete()
, but my business logic assumes that I will return items that were deleted
I can do this:
var deleted = DbContext.T.Where(entity => ..)
DbContext.RemoveRange(deleted)
but these are already two requests to database14 replies
The instance of entity type 'OptimizerInstanceEntity' cannot be tracked
Can someone help me to update model?
I want to create entity, add it to database and then update only instances
My command doesn't work, I got exception after trying to update:
6 replies
✅ How to fill the object without populating properties?
I have this record:
and in my code:
workingTask is
WorkingTask
record and flights is Flight
record, I need now somehow create a WorkingTaskWithFlights
but without populating properties of workingTask1 replies
✅ why dispose call is the latest in the chain?
Actually I have two questions here:
1. How actually duck typing works? Why I can do this:
but can't do the same with class, class requires to inherit
IDisposable
and it is strange:
2 question is: why dispose call is the latest in the chain? for example:
and output will be:
Created Factory!
Hello from class!
Hello from ref struct!11 replies
✅ how to merge two objects?
Sometimes ago I had this object:
LegData
used in method for merging and for example we can do this:
var firstLeg =
var secondLeg=
and the output will be:
then we decided move from JsonDocument to model and this merge doesn't work anymore
in case I pasted earlier output will be:
can someone understand me what to do?9 replies
System.AggregateException: 'Some services are not able to be constructed
I stuck with this problem and don't understand how to fix it:
InvalidOperationException: Unable to resolve service for type 'BackForFront.Settings.FlightLegAggregatorSettings' while attempting to activate 'BackForFront.Services.FlightLegAggregator.FlightLegAggregatorApi'.
api:
how I register it:
4 replies