Temptica
Temptica
CC#
Created by Temptica on 12/29/2023 in #help
Unity Setting Parent (XrOrigin)
So I have a player who needs to take a bus. But when the player steps on the bus, it just teleports to a very offset position. The bus has an animation, a bus object that is scaled which is just the visual model, a cube which detects if a person is trying to step on the bus, and offset which I'll explain later. The player has a cube in the camera offset which is the collision box (see screenshot 1) As code I have this on trigger Enter that checks if the bus is stopped and if the collider is a player. The collider is this cube so to get the Xr Origin I take transform.parent.parent. Then I get the offset object (it was a test solution, hence the bad tag and naming). This has a very big offset so when I attatch the player to it when you stepped on at the back, you end up at the exact same spot. This only works if you step exactly in the middle of the back door. If I use SetParent, no matter if I give true or false, or I set my parent this way, My player always ends up far away from the bus while still being attatched
1 replies
CC#
Created by Temptica on 12/21/2023 in #help
✅ Urgent | Cannot update property in EF because another instance with the same key is being tracked
Hi, so I have following code: Basically I get a batch to update the field
var batch = await context.Batch.FirstOrDefaultAsync(b => b.BatchId == id);
if (batch == null) throw new BatchNotFoundException($"No batch found with id {id}");
context.Entry(batch).Property(b => b.Status).IsModified = true;
batch.Status = status;
var batch = await context.Batch.FirstOrDefaultAsync(b => b.BatchId == id);
if (batch == null) throw new BatchNotFoundException($"No batch found with id {id}");
context.Entry(batch).Property(b => b.Status).IsModified = true;
batch.Status = status;
I get the error on the 'entry' line. If I leave it, it doesn't update the field (yes I do commit later on in my CQRS). I have a code freeze tomorrow night so henc ethe Urgency as It's an imprtant feature the client wants which they only let us know very late... Full error
The instance of entity type 'Batch' cannot be tracked because another instance with the same key value for {'BatchId'} is already being tracked. When attaching existing entities, ensure that only one entity instance with a given key value is attached. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting key values.
The instance of entity type 'Batch' cannot be tracked because another instance with the same key value for {'BatchId'} is already being tracked. When attaching existing entities, ensure that only one entity instance with a given key value is attached. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting key values.
43 replies
CC#
Created by Temptica on 11/26/2023 in #help
✅ Binding a RelayCommand in a CollectionView DataTemplate with an other object as DataType
No description
17 replies
CC#
Created by Temptica on 10/31/2023 in #help
✅ (SOLVED!) Bearer AUthentication in MVC using seperate API not working (HTTP 401)
No description
156 replies
CC#
Created by Temptica on 4/24/2023 in #help
❔ EF Core not create model on start-up
So I have an ASP.NET Web API running on docker which works. So does the SQL DB . The API can connect to the database. I can open the database with SSMS. But it only contains the default system databases. I have a working DBContext but somehow when in the docker container after performing docker-compose up, the Model has not been created. I added following line in the Program.cs
builder.Services.AddDbContext<UserContext>(option => option.UseSqlServer(builder.Configuration.GetConnectionString("ConnectionString")
builder.Services.AddDbContext<UserContext>(option => option.UseSqlServer(builder.Configuration.GetConnectionString("ConnectionString")
It works without docker
38 replies
CC#
Created by Temptica on 4/24/2023 in #help
❔ Docker file for Multi-layered project
61 replies
CC#
Created by Temptica on 4/12/2023 in #help
❔ ASP.NET api Timeout when fetching data from DB
So I’m working on an ASP.NET Core api with a database. It’s all running on localhost. I used EFC to perform data migration and that worked successfully. I know that my connection string is correct, and that data can be fetched in an instance. But when I perform a .find on my DBContext, I only get a time-put error after 15ish seconds. "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 40 - Could not open a connection to SQL Server: Could not open a connection to SQL Server)" Let me know what other info you need
8 replies
CC#
Created by Temptica on 8/30/2022 in #help
Json Parsing cuts of my string after serialising my object
8 replies