Skip to content

Commit

Permalink
.NET 8 support (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasBleijendaal authored Nov 21, 2023
1 parent 1648044 commit 9519a26
Show file tree
Hide file tree
Showing 778 changed files with 19,954 additions and 32,727 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/dotnetcore.pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@ jobs:

steps:
- uses: actions/checkout@v1
- name: Setup .NET Core
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
include-prerelease: true
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'
include-prerelease: true
- name: Build Api Core
run: dotnet build --configuration Release ./src/RapidCMS.Api.Core/RapidCMS.Api.Core.csproj
- name: Build Api Functions
Expand All @@ -24,15 +29,9 @@ jobs:
run: dotnet build --configuration Release ./src/RapidCMS.Api.WebApi/RapidCMS.Api.WebApi.csproj
- name: Build Core
run: dotnet build --configuration Release ./src/RapidCMS.Core/RapidCMS.Core.csproj
- name: Build ModelMaker
run: dotnet build --configuration Release ./src/RapidCMS.ModelMaker/RapidCMS.ModelMaker.csproj
- name: Build ModelMaker SourceGenerator EFCore
run: dotnet build --configuration Release ./src/RapidCMS.ModelMaker.SourceGenerator.EFCore/RapidCMS.ModelMaker.SourceGenerator.EFCore.csproj
- name: Build Repositories
run: dotnet build --configuration Release ./src/RapidCMS.Repositories/RapidCMS.Repositories.csproj
- name: Build UI
run: dotnet build --configuration Release ./src/RapidCMS.UI/RapidCMS.UI.csproj
- name: Run Core Tests
run: dotnet test ./src/RapidCMS.Core.Tests/RapidCMS.Core.Tests.csproj
- name: Run Model Maker Tests
run: dotnet test ./src/RapidCMS.ModelMaker.SourceGenerator.EFCore.Tests/RapidCMS.ModelMaker.SourceGenerator.EFCore.Tests.csproj
15 changes: 6 additions & 9 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ jobs:
- name: Get tag
id: tag
uses: dawidd6/action-get-tag@v1
- name: Setup .NET Core
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
include-prerelease: true
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'
include-prerelease: true
- uses: nuget/setup-nuget@v1
with:
nuget-api-key: ${{ secrets.NUGET_APIKEY }}
Expand All @@ -31,10 +36,6 @@ jobs:
run: dotnet build -p:PackageVersion=${{steps.tag.outputs.tag}} --configuration Release ./src/RapidCMS.Api.WebApi/RapidCMS.Api.WebApi.csproj
- name: Build Core
run: dotnet build -p:PackageVersion=${{steps.tag.outputs.tag}} --configuration Release ./src/RapidCMS.Core/RapidCMS.Core.csproj
- name: Build ModelMaker
run: dotnet build -p:PackageVersion=${{steps.tag.outputs.tag}} --configuration Release ./src/RapidCMS.ModelMaker/RapidCMS.ModelMaker.csproj
- name: Build ModelMaker SourceGenerator EFCore
run: dotnet build -p:PackageVersion=${{steps.tag.outputs.tag}} --configuration Release ./src/RapidCMS.ModelMaker.SourceGenerator.EFCore/RapidCMS.ModelMaker.SourceGenerator.EFCore.csproj
- name: Build Repositories
run: dotnet build -p:PackageVersion=${{steps.tag.outputs.tag}} --configuration Release ./src/RapidCMS.Repositories/RapidCMS.Repositories.csproj
- name: Build UI
Expand All @@ -47,10 +48,6 @@ jobs:
run: dotnet nuget push .\src\RapidCMS.Api.WebApi\bin\Release\*.nupkg -k ${{ secrets.NUGET_APIKEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
- name: Publish Core
run: dotnet nuget push .\src\RapidCMS.Core\bin\Release\*.nupkg -k ${{ secrets.NUGET_APIKEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
- name: Publish ModelMaker
run: dotnet nuget push .\src\RapidCMS.ModelMaker\bin\Release\*.nupkg -k ${{ secrets.NUGET_APIKEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
- name: Publish ModelMaker SourceGenerator EFCore
run: dotnet nuget push .\src\RapidCMS.ModelMaker.SourceGenerator.EFCore\bin\Release\*.nupkg -k ${{ secrets.NUGET_APIKEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
- name: Publish Repositories
run: dotnet nuget push .\src\RapidCMS.Repositories\bin\Release\*.nupkg -k ${{ secrets.NUGET_APIKEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
- name: Publish UI
Expand Down
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,12 @@ Since RapidCMS can be used in various ways, please pick a deployment mode. And r
- [Server-side RapidCMS](SETUP_SERVERSIDE.md) - requires an ASP.NET Core web server.
- [Client-side RapidCMS](SETUP_CLIENTSIDE.md) - can be statically hosted.
- [Companion API for client-side RapidCMS](SETUP_COMPANION.md) - requires an ASP.NET Core web server or Azure Function App.
- [MAUI RapidCMS](SETUP_MAUI.md).

### Authentication

- [Add authentication to Server-side](AUTHserver.md)
- [Add authentication to Client-side + Companion API](AUTHclient.md)

## How to setup RapidCMS Model Maker

- [Plugin into server-side RapidCMS](SETUP_MMSERVERSIDE.md).
- [Plugin into client-side RapidCMS with Companion API](SETUP_MMCLIENTSIDE.md).

## Quick starts

- [RapidCMS](QUICKSTART.md)
Expand Down
9 changes: 0 additions & 9 deletions SETUP_MAUI.md

This file was deleted.

40 changes: 0 additions & 40 deletions SETUP_MMCLIENTSIDE.md

This file was deleted.

19 changes: 0 additions & 19 deletions SETUP_MMSERVERSIDE.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
using System.ComponentModel.DataAnnotations;

namespace RapidCMS.Example.Github.Attributes
namespace RapidCMS.Example.Github.Attributes;

internal class BioValidationAttribute : ValidationAttribute
{
internal class BioValidationAttribute : ValidationAttribute
{
public override bool RequiresValidationContext => true;
public override bool RequiresValidationContext => true;

protected override ValidationResult IsValid(object? value, ValidationContext validationContext)
protected override ValidationResult IsValid(object? value, ValidationContext validationContext)
{
if (value is string bio)
{
if (value is string bio)
if (bio.Contains("fdsa"))
{
if (bio.Contains("fdsa"))
{
return new ValidationResult("Bio's cannot contain 'fdsa'.", validationContext.MemberName == null ? null : new[] { validationContext.MemberName });
}
return new ValidationResult("Bio's cannot contain 'fdsa'.", validationContext.MemberName == null ? null : new[] { validationContext.MemberName });
}

return ValidationResult.Success!;
}

return ValidationResult.Success!;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
using RapidCMS.Core.Models.Data;
using RapidCMS.Example.Github.Entities;

namespace RapidCMS.Example.Github.DataViewBuilders
{
internal class CountryDataViewBuilder : DataViewBuilder<Country>
{
public override Task<IEnumerable<DataView<Country>>> GetDataViewsAsync()
{
return Task.FromResult(Enumerable.Range(1, 10).Select(index => new DataView<Country>(index, $"{index}-letter country", x => x.Name != null && x.Name.Length == index)));
}
namespace RapidCMS.Example.Github.DataViewBuilders;

internal class CountryDataViewBuilder : DataViewBuilder<Country>
{
public override Task<IEnumerable<DataView<Country>>> GetDataViewsAsync()
{
return Task.FromResult(Enumerable.Range(1, 10).Select(index => new DataView<Country>(index, $"{index}-letter country", x => x.Name != null && x.Name.Length == index)));
}
}
41 changes: 20 additions & 21 deletions examples/RapidCMS.Example.Github/Entities/ConventionPerson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,32 @@
using RapidCMS.Core.Abstractions.Data;
using RapidCMS.Core.Attributes;

namespace RapidCMS.Example.Github.Entities
namespace RapidCMS.Example.Github.Entities;

internal class ConventionPerson : IEntity, ICloneable
{
internal class ConventionPerson : IEntity, ICloneable
{
public string? Id { get; set; }
public string? Id { get; set; }

[Field(Name = "Name", ListName = "Name")]
public string? Name { get; set; }
[Field(Name = "Name", ListName = "Name")]
public string? Name { get; set; }

[Field(Name = "Email")]
public string? Email { get; set; }
[Field(Name = "Email")]
public string? Email { get; set; }

[Field(Name = "Bio", Description = "If this field gets longer than 50, the summary on the ListView will get truncated.")]
public string? Bio { get; set; }
[Field(Name = "Bio", Description = "If this field gets longer than 50, the summary on the ListView will get truncated.")]
public string? Bio { get; set; }

[Field(ListName = "Bio summary")]
public string? ShortBio => Bio?.Substring(0, Math.Min(Bio?.Length ?? 0, 50));
[Field(ListName = "Bio summary")]
public string? ShortBio => Bio?.Substring(0, Math.Min(Bio?.Length ?? 0, 50));

public object Clone()
public object Clone()
{
return new ConventionPerson
{
return new ConventionPerson
{
Bio = Bio,
Email = Email,
Id = Id,
Name = Name
};
}
Bio = Bio,
Email = Email,
Id = Id,
Name = Name
};
}
}
23 changes: 11 additions & 12 deletions examples/RapidCMS.Example.Github/Entities/Country.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
using System;
using RapidCMS.Core.Abstractions.Data;

namespace RapidCMS.Example.Github.Entities
namespace RapidCMS.Example.Github.Entities;

internal class Country : IEntity, ICloneable
{
internal class Country : IEntity, ICloneable
{
public string? Id { get; set; }
public string? Name { get; set; }
public string? Id { get; set; }
public string? Name { get; set; }

public object Clone()
public object Clone()
{
return new Country
{
return new Country
{
Id = Id,
Name = Name
};
}
Id = Id,
Name = Name
};
}
}
39 changes: 19 additions & 20 deletions examples/RapidCMS.Example.Github/Entities/CountryPerson.cs
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
using System;
using RapidCMS.Core.Abstractions.Data;

namespace RapidCMS.Example.Github.Entities
namespace RapidCMS.Example.Github.Entities;

internal class CountryPerson : IEntity, ICloneable
{
internal class CountryPerson : IEntity, ICloneable
{
public string? Id { get; set; }
public string? Name { get; set; }
public string? Email { get; set; }
public string? Bio { get; set; }
public string? Id { get; set; }
public string? Name { get; set; }
public string? Email { get; set; }
public string? Bio { get; set; }

public string? FavouriteCountryId1 { get; set; }
public string? FavouriteCountryId2 { get; set; }
public string? FavouriteCountryId1 { get; set; }
public string? FavouriteCountryId2 { get; set; }

public object Clone()
public object Clone()
{
return new CountryPerson
{
return new CountryPerson
{
Bio = Bio,
Email = Email,
Id = Id,
Name = Name,
FavouriteCountryId1 = FavouriteCountryId1,
FavouriteCountryId2 = FavouriteCountryId2
};
}
Bio = Bio,
Email = Email,
Id = Id,
Name = Name,
FavouriteCountryId1 = FavouriteCountryId1,
FavouriteCountryId2 = FavouriteCountryId2
};
}
}
31 changes: 15 additions & 16 deletions examples/RapidCMS.Example.Github/Entities/Person.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
using System;
using RapidCMS.Core.Abstractions.Data;

namespace RapidCMS.Example.Github.Entities
namespace RapidCMS.Example.Github.Entities;

internal class Person : IEntity, ICloneable
{
internal class Person : IEntity, ICloneable
{
public string? Id { get; set; }
public string? Name { get; set; }
public string? Email { get; set; }
public string? Bio { get; set; }
public string? Id { get; set; }
public string? Name { get; set; }
public string? Email { get; set; }
public string? Bio { get; set; }

public object Clone()
public object Clone()
{
return new Person
{
return new Person
{
Bio = Bio,
Email = Email,
Id = Id,
Name = Name
};
}
Bio = Bio,
Email = Email,
Id = Id,
Name = Name
};
}
}
Loading

0 comments on commit 9519a26

Please sign in to comment.