Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions csharp/effinitive-framework/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using EffinitiveFramework.Core;

var app = EffinitiveApp
.Create()
.UsePort(3000)
.MapEndpoints()
.Build();

await app.RunAsync();

public class RootEndpoint : AsyncEndpointBase<EmptyRequest, EmptyResponse>
{
protected override string Method => "GET";
protected override string Route => "/";

public override Task<EmptyResponse> HandleAsync(
EmptyRequest request,
CancellationToken cancellationToken = default)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this for ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you reffering to the CancellationToken cancellationToken = default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or my handler like endpoints?

Copy link
Collaborator

@waghanza waghanza Nov 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CancellationToken cancellationToken = default)

is just a curiosity

{
return Task.FromResult(new EmptyResponse());
}
}

public class GetUserEndpoint : AsyncEndpointBase<UserIdRequest, string>
{
protected override string Method => "GET";
protected override string Route => "/user/{id}";

public override Task<string> HandleAsync(
UserIdRequest request,
CancellationToken cancellationToken = default)
{
return Task.FromResult(request.Id);
}
}

public class CreateUserEndpoint : AsyncEndpointBase<EmptyRequest, EmptyResponse>
{
protected override string Method => "POST";
protected override string Route => "/user";

public override Task<EmptyResponse> HandleAsync(
EmptyRequest request,
CancellationToken cancellationToken = default)
{
return Task.FromResult(new EmptyResponse());
}
}

public class EmptyRequest { }
public class EmptyResponse { }
public class UserIdRequest
{
public string Id { get; set; } = string.Empty;
}
3 changes: 3 additions & 0 deletions csharp/effinitive-framework/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
framework:
github: HBartosch/Effinitive
version: 1.0
10 changes: 10 additions & 0 deletions csharp/effinitive-framework/web.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="EffinitiveFramework.Core" Version="1.0.*" />
</ItemGroup>
</Project>
Loading