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
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ dotnet_diagnostic.CA2246.severity = warning
# CA2249: Use string.Contains instead of string.IndexOf to improve readability.
dotnet_diagnostic.CA2249.severity = warning

# CS1591: Missing XML comment for publicly visible type or member
dotnet_diagnostic.CS1591.severity = suggestion

# IDE0005: Remove unnecessary usings
dotnet_diagnostic.IDE0005.severity = warning

Expand Down Expand Up @@ -298,6 +301,9 @@ dotnet_diagnostic.IDE0060.severity = warning
# IDE0062: Make local function static
dotnet_diagnostic.IDE0062.severity = warning

# IDE0130: Namespace does not match folder structure
dotnet_diagnostic.IDE0130.severity = none

# IDE0161: Convert to file-scoped namespace
dotnet_diagnostic.IDE0161.severity = warning

Expand Down
1 change: 1 addition & 0 deletions Cofoundry.sln
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{4996A61A-00E1-4363-9BC7-1F877E4AD933}"
ProjectSection(SolutionItems) = preProject
src\Directory.Build.props = src\Directory.Build.props
README.md = README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{8FCDFF68-9BCF-499B-8E2D-7E08E824F40A}"
Expand Down
7 changes: 2 additions & 5 deletions docs/user-docs/Framework/Background Tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ public class ImportDataBackgroundTask : IAsyncRecurringBackgroundTask
{
private readonly IDomainRepository _domainRepository;

public ImportDataBackgroundTask(
IDomainRepository domainRepository
)
public ImportDataBackgroundTask(IDomainRepository domainRepository)
{
_domainRepository = domainRepository;
}
Expand All @@ -37,8 +35,7 @@ public class BackgroundTaskRegistration : IBackgroundTaskRegistration
{
public void Register(IBackgroundTaskScheduler scheduler)
{
scheduler
.RegisterRecurringTask<ImportDataBackgroundTask>(1, 6, 5);
scheduler.RegisterRecurringTask<ImportDataBackgroundTask>(1, 6, 5);
}
}
```
Expand Down
4 changes: 1 addition & 3 deletions docs/user-docs/Framework/Caching.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ public class ImageAssetCache
private const string IMAGE_ASSET_RENDER_DETAILS_CACHEKEY = "ImageAssetRenderDetails:";
private readonly IObjectCache _cache;

public ImageAssetCache(
IObjectCacheFactory cacheFactory
)
public ImageAssetCache(IObjectCacheFactory cacheFactory)
{
_cache = cacheFactory.Get("COF_ImageAssets");
}
Expand Down
4 changes: 1 addition & 3 deletions docs/user-docs/Framework/Configuration Settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ public class ContactController : Controller
{
private readonly ContactFormSettings _simpleTestSiteSettings;

public ContactController(
ContactFormSettings simpleTestSiteSettings
)
public ContactController(ContactFormSettings simpleTestSiteSettings)
{
_simpleTestSiteSettings = simpleTestSiteSettings;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ public class SetCatFavoriteCommandHandler
new SqlParameter("@CatId", command.CatId),
new SqlParameter("@UserId", executionContext.UserContext.UserId),
new SqlParameter("@IsLiked", command.IsFavorite),
new SqlParameter("@CreateDate", executionContext.ExecutionDate)
);
new SqlParameter("@CreateDate", executionContext.ExecutionDate));
}
}
```
11 changes: 3 additions & 8 deletions docs/user-docs/Framework/Data Access/Transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ public class AddProductHandler
public AddProductHandler(
MyDbContext myDbContext,
ITransactionScopeManager transactionScopeManager,
ICommandExecutor commandExecutor
)
ICommandExecutor commandExecutor)
{
_myDbContext = myDbContext;
_transactionScopeManager = transactionScopeManager;
Expand Down Expand Up @@ -57,9 +56,7 @@ public class TransactionExample
{
private readonly IAdvancedContentRepository _contentRepository;

public TransactionExample(
IAdvancedContentRepository contentRepository
)
public TransactionExample(IAdvancedContentRepository contentRepository)
{
_contentRepository = contentRepository;
}
Expand Down Expand Up @@ -166,9 +163,7 @@ public class TransactionExample
{
private readonly IAdvancedContentRepository _contentRepository;

public TransactionExample(
IAdvancedContentRepository contentRepository
)
public TransactionExample(IAdvancedContentRepository contentRepository)
{
_contentRepository = contentRepository;
}
Expand Down
7 changes: 3 additions & 4 deletions docs/user-docs/Framework/Dependency Injection.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ public class MyAssemblyDiscoveryRule : IAssemblyDiscoveryRule
{
public bool CanInclude(
RuntimeLibrary libraryToCheck,
IAssemblyDiscoveryRuleContext context
)
IAssemblyDiscoveryRuleContext context)
{
return libraryToCheck.Name.StartsWith("MyNamespace.");
}
Expand All @@ -106,8 +105,8 @@ public class MyAssemblyDiscoveryRule : IAssemblyDiscoveryRule
builder
.Services
.AddMvc()
.AddCofoundry(builder.Configuration, c =>
.AddCofoundry(builder.Configuration, config =>
{
c.AssemblyDiscoveryRules.Add(new MyAssemblyDiscoveryRule());
config.AssemblyDiscoveryRules.Add(new MyAssemblyDiscoveryRule());
});
```
6 changes: 3 additions & 3 deletions docs/user-docs/Framework/JSON Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ This can be done in your `Program.cs` file by re-applying the `AddNewtonsoftJson
builder.Services
.AddMvc()
.AddCofoundry(builder.Configuration)
.AddNewtonsoftJson(o =>
.AddNewtonsoftJson(options =>
{
// e.g. reset the contract resolver to use PascalCase.
o.SerializerSettings.ContractResolver = new DefaultContractResolver();
JsonConvert.DefaultSettings = () => o.SerializerSettings;
options.SerializerSettings.ContractResolver = new DefaultContractResolver();
JsonConvert.DefaultSettings = () => options.SerializerSettings;
});
```

Expand Down
8 changes: 2 additions & 6 deletions docs/user-docs/Framework/Message Aggregator.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ public class BlogPostDeletedMessageHandler : IMessageHandler<CustomEntityDeleted
{
private readonly IExampleSearchIndexRepository _exampleSearchIndexRepository;

public BlogPostDeletedMessageHandler(
IExampleSearchIndexRepository exampleSearchIndexRepository
)
public BlogPostDeletedMessageHandler(IExampleSearchIndexRepository exampleSearchIndexRepository)
{
_exampleSearchIndexRepository = exampleSearchIndexRepository;
}
Expand Down Expand Up @@ -108,9 +106,7 @@ public class AddPageCommandHandler
{
private readonly IMessageAggregator _messageAggregator;

public AddPageCommandHandler(
IMessageAggregator messageAggregator
)
public AddPageCommandHandler(IMessageAggregator messageAggregator)
{
_messageAggregator = messageAggregator;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ public class DeleteCustomEntityCommandHandler

public DeleteCustomEntityCommandHandler(
CofoundryDbContext dbContext,
IPermissionValidationService permissionValidationService
)
IPermissionValidationService permissionValidationService)
{
_dbContext = dbContext;
_permissionValidationService = permissionValidationService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ public class PermissionChecker

public PermissionChecker(
IPermissionValidationService permissionValidationService,
IUserContextService userContextService
)
IUserContextService userContextService)
{
_permissionValidationService = permissionValidationService;
_userContextService = userContextService;
Expand Down
4 changes: 1 addition & 3 deletions docs/user-docs/Framework/Startup Tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ public class MessageAggregatorStartupConfigurationTask : IStartupConfigurationTa
{
private readonly IMessageSubscriptionInitializer _messageSubscriptionInitializer;

public MessageAggregatorStartupConfigurationTask(
IMessageSubscriptionInitializer messageSubscriptionInitializer
)
public MessageAggregatorStartupConfigurationTask(IMessageSubscriptionInitializer messageSubscriptionInitializer)
{
_messageSubscriptionInitializer = messageSubscriptionInitializer;
}
Expand Down
5 changes: 1 addition & 4 deletions docs/user-docs/Framework/Static Files.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,7 @@ public class ExampleEmbeddedResourcetRouteRegistration : IEmbeddedResourceRouteR
{
public IEnumerable<EmbeddedResourcePath> GetEmbeddedResourcePaths()
{
var path = new EmbeddedResourcePath(
GetType().Assembly,
"/MyAssemblyStaticFiles"
);
var path = new EmbeddedResourcePath(GetType().Assembly, "/MyAssemblyStaticFiles");

yield return path;
}
Expand Down
10 changes: 5 additions & 5 deletions docs/user-docs/Framework/Website Startup.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ As a last resort we also provide a configuration option that lets you filter the
```csharp
// ..other app builder code ommited

app.UseCofoundry(c =>
app.UseCofoundry(config =>
{
c.StartupTaskFilter = startupTasks =>
config.StartupTaskFilter = startupTasks =>
{
return startupTasks.Where(t => t is not JsonConverterStartupConfigurationTask);
return startupTasks.Where(task => task is not JsonConverterStartupConfigurationTask);
};
});
```
Expand Down Expand Up @@ -111,8 +111,8 @@ public class ExampleAssemblyDiscoveryRule : IAssemblyDiscoveryRule

builder.Services
.AddMvc()
.AddCofoundry(builder.Configuration, c =>
.AddCofoundry(builder.Configuration, config =>
{
c.AssemblyDiscoveryRules.Add(new ExampleAssemblyDiscoveryRule());
config.AssemblyDiscoveryRules.Add(new ExampleAssemblyDiscoveryRule());
});
```
12 changes: 6 additions & 6 deletions docs/user-docs/Getting Started/Installing.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Requirements

- .NET 8
- .NET 10
- SqlServer (Express) 2019 or later, or Azure SQL

## Creating a new project using the .NET CLI
Expand Down Expand Up @@ -33,13 +33,13 @@ This is just an example of how you'd typically create a new site, but you can qu

### Creating the site

1. Open Visual Studio 2022 and select **Create a new project**
1. Open Visual Studio 2026 and select **Create a new project**

2. Select the "ASP.NET Core Web App (Model-View-Controller)" template and press **Next**

3. Fill in the project name, select a location and press **Next**

4. Ensure ".NET 8.0 (Long-term support)" is selected as the framework and "None" is selected as the authentication type, then press *Create*
4. Ensure ".NET 10.0 (Long-term support)" is selected as the framework and "None" is selected as the authentication type, then press *Create*

5. Create an empty database in SQL Server.

Expand Down Expand Up @@ -89,11 +89,11 @@ app.Run();
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<MvcRazorExcludeViewFilesFromPublish>false</MvcRazorExcludeViewFilesFromPublish>
<MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish>
<MvcRazorExcludeViewFilesFromPublish>false</MvcRazorExcludeViewFilesFromPublish>
<MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish>
</PropertyGroup>

<!-- other nodes removed for clarity -->
Expand Down
2 changes: 1 addition & 1 deletion docs/user-docs/Getting Started/Overview.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Cofoundry is an open source .NET application framework and content management platform. Whilst content management and website tools are a large part of Cofoundry, the functionality is entirely optional and our base framework is available to you to use in any application that references .NET 6.
Cofoundry is an open source .NET application framework and content management platform. Whilst content management and website tools are a large part of Cofoundry, the functionality is entirely optional and our base framework is available to you to use in any .NET 10 application.

We see the role of developing an application as very separate from managing content and so we don't squeeze everything into the same management GUI, instead we focus on modular and extensible code-first tools for building sites and a simple, clean interface for managing them.

Expand Down
6 changes: 3 additions & 3 deletions docs/user-docs/Getting Started/Publishing & Deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ To work around this issue you'll need to add two settings to your .csproj projec
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<MvcRazorExcludeViewFilesFromPublish>false</MvcRazorExcludeViewFilesFromPublish>
<MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish>
<MvcRazorExcludeViewFilesFromPublish>false</MvcRazorExcludeViewFilesFromPublish>
<MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish>
</PropertyGroup>

<!-- other nodes removed for clarity -->
Expand Down
3 changes: 1 addition & 2 deletions docs/user-docs/User Areas/Configuration/Password Policies.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ public class AdminPasswordPolicyConfiguration : IPasswordPolicyConfiguration<Cof
.ValidateMinUniqueCharacters(5)
.ValidateNotCurrentPassword()
.ValidateNotPersonalData()
.ValidateNotSequential()
;
.ValidateNotSequential();
}
}
```
Expand Down
3 changes: 1 addition & 2 deletions docs/user-docs/User Areas/Configuration/Usernames.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ public class ExampleUsernameValidator : UsernameValidator
{
public ExampleUsernameValidator(
IUserAreaDefinitionRepository userAreaDefinitionRepository,
IAdvancedContentRepository contentRepository
)
IAdvancedContentRepository contentRepository)
: base(userAreaDefinitionRepository, contentRepository)
{
}
Expand Down
3 changes: 1 addition & 2 deletions docs/user-docs/User Areas/Data APIs/Account Recovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ public class MemberController : Controller

public MemberController(
IAdvancedContentRepository advancedContentRepository,
IAuthorizedTaskTokenUrlHelper authorizedTaskTokenUrlHelper
)
IAuthorizedTaskTokenUrlHelper authorizedTaskTokenUrlHelper)
{
_advancedContentRepository = advancedContentRepository;
_authorizedTaskTokenUrlHelper = authorizedTaskTokenUrlHelper;
Expand Down
3 changes: 1 addition & 2 deletions docs/user-docs/User Areas/Data APIs/Account Verification.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ public class MemberController : Controller

public MemberController(
IAdvancedContentRepository advancedContentRepository,
IAuthorizedTaskTokenUrlHelper authorizedTaskTokenUrlHelper
)
IAuthorizedTaskTokenUrlHelper authorizedTaskTokenUrlHelper)
{
_advancedContentRepository = advancedContentRepository;
_authorizedTaskTokenUrlHelper = authorizedTaskTokenUrlHelper;
Expand Down
7 changes: 2 additions & 5 deletions docs/user-docs/User Areas/Data APIs/Authorized Tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ public class InviteMemberCommandHandler
public InviteMemberCommandHandler(
IAdvancedContentRepository contentRepository,
IAuthorizedTaskTokenUrlHelper authorizedTaskTokenUrlHelper,
ISiteUrlResolver siteUrlResolver
)
ISiteUrlResolver siteUrlResolver)
{
_contentRepository = contentRepository;
_authorizedTaskTokenUrlHelper = authorizedTaskTokenUrlHelper;
Expand Down Expand Up @@ -229,9 +228,7 @@ public class MembersApiController : ControllerBase
{
private readonly IAdvancedContentRepository _contentRepository;

public MembersApiController(
IAdvancedContentRepository contentRepository
)
public MembersApiController(IAdvancedContentRepository contentRepository)
{
_contentRepository = contentRepository;
}
Expand Down
2 changes: 1 addition & 1 deletion eng/Base.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
Expand Down
2 changes: 1 addition & 1 deletion eng/Cofoundry.Build/Cofoundry.Build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Bullseye" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="10.0.1" />
<PackageReference Include="SimpleExec" Version="12.0.0" />
</ItemGroup>
<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions eng/Cofoundry.DocGenerator/Cofoundry.DocGenerator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Azure.Storage.Blobs" Version="12.25.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.1" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.26.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="10.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="10.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading