aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorivarlovlie <git@ivarlovlie.no>2022-11-19 08:03:54 +0100
committerivarlovlie <git@ivarlovlie.no>2022-11-19 08:03:54 +0100
commit09250198cdd7a7c13bc50664ef3c8b51bdc1ea8b (patch)
tree963c5ffe58e8a9809db21f24fd792032250c113c
parentf48f101eb0dd6bbdca91d5f50b4ce4194d7369ab (diff)
downloaddotnet-endpoints-09250198cdd7a7c13bc50664ef3c8b51bdc1ea8b.tar.xz
dotnet-endpoints-09250198cdd7a7c13bc50664ef3c8b51bdc1ea8b.zip
feat: Release v1.0.0v1.0.0
-rw-r--r--src/EndpointGenerator.cs81
-rw-r--r--src/I2R.Endpoints.csproj13
2 files changed, 17 insertions, 77 deletions
diff --git a/src/EndpointGenerator.cs b/src/EndpointGenerator.cs
index 58dbff6..c0b7c1b 100644
--- a/src/EndpointGenerator.cs
+++ b/src/EndpointGenerator.cs
@@ -1,5 +1,3 @@
-using System.Text;
-using System.Text.Json;
using System.Text.RegularExpressions;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Syntax;
@@ -62,6 +60,7 @@ public class EndpointGenerator : ISourceGenerator
private string GetSyncSource(string className, string namespaceName) {
return $@"
+{SourceGenereatedComment}
namespace {namespaceName};
public static partial class SyncEndpoint<T{className}>
{{
@@ -100,6 +99,7 @@ public static partial class SyncEndpoint<T{className}>
private string GetAsyncSource(string className, string namespaceName) {
return $@"
+{SourceGenereatedComment}
namespace {namespaceName};
public static partial class AsyncEndpoint<T>
{{
@@ -146,11 +146,11 @@ public static partial class AsyncEndpoint<T>
static string GetNamespace(BaseTypeSyntax syntax) {
// If we don't have a namespace at all we'll return an empty string
// This accounts for the "default namespace" case
- string nameSpace = string.Empty;
+ var nameSpace = string.Empty;
// Get the containing syntax node for the type declaration
// (could be a nested type, for example)
- SyntaxNode? potentialNamespaceParent = syntax.Parent;
+ var potentialNamespaceParent = syntax.Parent;
// Keep moving "out" of nested classes etc until we get to a namespace
// or until we run out of parents
@@ -181,75 +181,4 @@ public static partial class AsyncEndpoint<T>
// return the final namespace
return nameSpace;
}
-}
-
-
-/*
- public static class Req<TRequest> : BaseEndpoint
- {
- public abstract class Res<TResponse> : BaseEndpoint
- {
- public abstract Task<TResponse> HandleAsync(
- TRequest request,
- CancellationToken cancellationToken = default
- );
- }
-
- public abstract class NoRes
- {
- public abstract Task HandleAsync(
- TRequest request,
- CancellationToken cancellationToken = default
- );
- }
- }
-
- public static class NoReq
- {
- public abstract class Res<TResponse>
- {
- public abstract Task<TResponse> HandleAsync(
- CancellationToken cancellationToken = default
- );
- }
-
- public abstract class NoRes
- {
- public abstract Task HandleAsync(
- CancellationToken cancellationToken = default
- );
- }
- }
- */
-
-/*
- public static class Req<TRequest>
- {
- public abstract class Res<TResponse>
- {
- public abstract TResponse Handle(
- TRequest request
- );
- }
-
- public abstract class NoRes
- {
- public abstract void Handle(
- TRequest request
- );
- }
- }
-
- public static class NoReq
- {
- public abstract class Res<TResponse>
- {
- public abstract TResponse Handle();
- }
-
- public abstract class NoRes
- {
- public abstract void Handle();
- }
- }
- */ \ No newline at end of file
+} \ No newline at end of file
diff --git a/src/I2R.Endpoints.csproj b/src/I2R.Endpoints.csproj
index c4d4c67..4948bed 100644
--- a/src/I2R.Endpoints.csproj
+++ b/src/I2R.Endpoints.csproj
@@ -2,7 +2,18 @@
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
-
+ <PackageProjectUrl>https://git.ivar.systems/dotnet-endpoints</PackageProjectUrl>
+ <PackageLicenseUrl>https://git.ivar.systems/dotnet-endpoints/tree/COPYING</PackageLicenseUrl>
+ <RepositoryUrl>https://git.ivar.systems/dotnet-endpoints</RepositoryUrl>
+ <RepositoryType>git</RepositoryType>
+ <PackageVersion>1.0.0</PackageVersion>
+ <Title>I2R.Endpoints</Title>
+ <Authors>Ivar Løvlie</Authors>
+ <Description>A library that enables single file endpoints (or whatever).</Description>
+ <Copyright>Ivar Løvlie</Copyright>
+ <PackageReleaseNotes>
+ Initial realease.
+ </PackageReleaseNotes>
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />