Casper
Casper
Explore posts from servers
WWindmill
Created by Casper on 1/16/2025 in #help
How to sync scripts from windmill cloud to local dev machine
No description
13 replies
CC#
Created by Casper on 1/13/2025 in #help
How to add razor pages to razor class library and reference from Blazor server project?
I am trying to place all my razor pages and components inside a razor class library to modularize the code to pack as a nuget package. I can get the components rendered but routing to pages just wont work. I have added the assembly to be scanned in the blazor web project as such and referenced the project in the csproj file:
@using System.Reflection
@using AppBlueprint.UiKit.Components.Pages

<Router AppAssembly="@typeof(Program).Assembly"
AdditionalAssemblies="@AdditionalAssemblies">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
</Found>
<NotFound>
<MudText Typo="Typo.h6">Sorry, there's nothing here!</MudText>
</NotFound>
</Router>

@code {
private Assembly[] AdditionalAssemblies { get; } = new[] { typeof(AppBlueprint.UiKit.Components.Pages.Dashboard).Assembly };

protected override void OnInitialized()
{
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
{
Console.WriteLine($"Loaded Assembly: {assembly.FullName}");
}
}
}
@using System.Reflection
@using AppBlueprint.UiKit.Components.Pages

<Router AppAssembly="@typeof(Program).Assembly"
AdditionalAssemblies="@AdditionalAssemblies">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
</Found>
<NotFound>
<MudText Typo="Typo.h6">Sorry, there's nothing here!</MudText>
</NotFound>
</Router>

@code {
private Assembly[] AdditionalAssemblies { get; } = new[] { typeof(AppBlueprint.UiKit.Components.Pages.Dashboard).Assembly };

protected override void OnInitialized()
{
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
{
Console.WriteLine($"Loaded Assembly: {assembly.FullName}");
}
}
}
`
5 replies
CC#
Created by Casper on 10/24/2024 in #help
Dynamic parsing different document types from Elastic Search
I am trying to fetch documents with different types of fields and nested fields from elastic search using NEST SDK and I am having issues parsing the documents into their appropriate types for example YoutubeVideo or TrelloCard which have different fields and structure. I am doing a free text search across all fields for the different types of documents in a single index and want to dynamically map them to specific C# model class for example Class TrelloCard. I have tried using Generics, pattern matching and so on. However I am unable to return the Source object eg. TrelloCard or YoutubeVideo from my search method. The JSON search result from Elastic search looks like this for the YoutubeVideo document type and the document data that I want to extract and parse is in the "_source" object:
{
"took" : 5,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 205,
"relation" : "eq"
},
"max_score" : 1.5206873,
"hits" : [
{
"_index" : "global-dev",
"_type" : "_doc",
"_id" : "23qNtJIBgw6_7scS9GAD",
"_score" : 1.5206873,
"_source" : {
"kind" : "youtube#playlistItem",
"etag" : "iHgQaZpSuxlCTGAHG8zsESDCVDA",
"id" : "UExnS01oN1JBZkVWY2GAek1USk04MlhEVHZ1ZlV5MDBuZS4yODlGNEE0NkRGMEEzMEQy",
"type" : "youtube-videos",
"url": "https://www.youtube.com/watch?v=KAH_D3ELDA",
"NestedObject": {
"Description": "Test"
}
}
}
]
}
}
{
"took" : 5,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 205,
"relation" : "eq"
},
"max_score" : 1.5206873,
"hits" : [
{
"_index" : "global-dev",
"_type" : "_doc",
"_id" : "23qNtJIBgw6_7scS9GAD",
"_score" : 1.5206873,
"_source" : {
"kind" : "youtube#playlistItem",
"etag" : "iHgQaZpSuxlCTGAHG8zsESDCVDA",
"id" : "UExnS01oN1JBZkVWY2GAek1USk04MlhEVHZ1ZlV5MDBuZS4yODlGNEE0NkRGMEEzMEQy",
"type" : "youtube-videos",
"url": "https://www.youtube.com/watch?v=KAH_D3ELDA",
"NestedObject": {
"Description": "Test"
}
}
}
]
}
}
7 replies
CDCloudflare Developers
Created by Casper on 8/1/2024 in #general-help
Feature request: Additional Cloudflare workers programming languages
I would like to use C# and Python to write Cloudflare workers code - are there plans to implement this?
21 replies
CDCloudflare Developers
Created by Casper on 6/10/2023 in #general-help
DDOS protection
- Is protection enabled by default for all domains? - Is it free of charge and unmetered on the Free plan and how does it work? - Can I make adjustments to it using infrastructure code such as Pulumi?
20 replies
CC#
Created by Casper on 3/28/2023 in #help
❔ how to listen to the output of a virtual audio device on windows using C#?
how to listen to the output of a virtual audio device on windows using C# to save the raw audio stream to a music file such as .wav?
12 replies
CC#
Created by Casper on 10/30/2022 in #help
how to authenticate visual studio to Azure devops private nuget feed?
I have tried adding it through visual studio and logging in with my Microsoft account but it does not work
12 replies