Ownix
Ownix
Explore posts from servers
SIASapphire - Imagine a framework
Created by Ownix on 5/22/2024 in #sapphire-support
Just updated to 5.2.1 nothing working and no errors
No description
28 replies
NNuxt
Created by Ownix on 5/13/2024 in #❓・help
dev does not refresh when I change a page
Generated a new app via npx nuxi@latest init -t ui Disabled srr with ssr: false When I change a vue page, I have to stop and restart my whole app.
1 replies
NNuxt
Created by Ownix on 5/13/2024 in #❓・help
How to provide a client-side dependency to my app?
For example, an API client on NPM like so https://www.npmjs.com/package/pocketbase#specify-typescript-definitions Any page/component should be able to use that from the browser.
2 replies
CC#
Created by Ownix on 8/25/2023 in #help
❔ If you needed to bulk sync data from an API into a DB, what would you use as a PK for child data?
For example imagine you get this data back HOURLY from GET /users:
{
"users": [
{
"Id": 1,
"Addresses": [
{
"Street": "123 Main St",
"City": "Anytown",
"State": "CA"
},
{
"Street": "123 Main St",
"City": "Anytown",
"State": "CA"
}
]
},
{
"Id": 2,
"Addresses": [
{
"Street": "456 Main St",
"City": "MyTown",
"State": "CA"
},
{
"Street": "123 Main St",
"City": "Anytown",
"State": "CA"
}
]
}
]
}
{
"users": [
{
"Id": 1,
"Addresses": [
{
"Street": "123 Main St",
"City": "Anytown",
"State": "CA"
},
{
"Street": "123 Main St",
"City": "Anytown",
"State": "CA"
}
]
},
{
"Id": 2,
"Addresses": [
{
"Street": "456 Main St",
"City": "MyTown",
"State": "CA"
},
{
"Street": "123 Main St",
"City": "Anytown",
"State": "CA"
}
]
}
]
}
You obviously would have a dbo.user table and a dbo.user_address table. dbo.user would have PK Id and dbo.user_address would have an FK of UserId. But what about a PK for the address table? How could you possibly update an address without having a unique identifier from it? SHould I just TRUNCATE followed by INSERT?
2 replies
CC#
Created by Ownix on 8/2/2023 in #help
❔ Is there a pattern for having a single collection of different object types?
This is my sample code https://dotnetfiddle.net/ffV3vY I have a WorkflowCommand a ScheduledWorkflowCommanddepending on their type they are executed in different ways. I would like to have a collection of them I can pass around and enumerate.
7 replies
CC#
Created by Ownix on 7/23/2023 in #help
❔ Argument 1: cannot convert from 'Ardalis.Result.Result' to 'TResponse'
https://dotnetfiddle.net/uebISh Line 96. I have a contsraint that says where TResponse : Result so I am very confused about this error. Result.Error("Whatever."); IS Ardalis.Result.Result type...
12 replies
CC#
Created by Ownix on 5/17/2023 in #help
❔ Dusplicate type names: using namespace vs changing the type names.
4 replies
CC#
Created by Ownix on 5/12/2023 in #help
❔ RazorPages - require authorization, but load title/Open Graph information still?
I have a page that requires authorization, is there a way to let the title appear for example when someone copies a link into Confluence or Microsoft Teams the page title loads in the preview?
3 replies
CC#
Created by Ownix on 4/14/2023 in #help
❔ Unit Testing dynamic data
I have a ton of unit tests that look like the following:
using Dapper;
using FluentAssertions;

[Fact]
public void MyTest()
{
var queryResults = connection
.Query("SELECT TOP 1 * FROM Locations;");

var firstLocation = queryResults.ToList()[0];

// Regarding extension methods (FluentAssertions) on dynamic data:
// https://github.com/fluentassertions/fluentassertions/issues/234
((object)firstLocation.LocationName).Should().Be("Hello World");
((object)firstLocation.Location_id).Should().Be("001");
}
using Dapper;
using FluentAssertions;

[Fact]
public void MyTest()
{
var queryResults = connection
.Query("SELECT TOP 1 * FROM Locations;");

var firstLocation = queryResults.ToList()[0];

// Regarding extension methods (FluentAssertions) on dynamic data:
// https://github.com/fluentassertions/fluentassertions/issues/234
((object)firstLocation.LocationName).Should().Be("Hello World");
((object)firstLocation.Location_id).Should().Be("001");
}
I want to clean up all of the casting on the dynamic data there. I realize I could strongly type the query (.Query<Location>) however I have a LOT of tests and composing exact typings for my database seems like overkill doesn't it?
22 replies
CC#
Created by Ownix on 3/2/2023 in #help
❔ "The server has not been started or no web application was configured."
2 replies