-
-
Notifications
You must be signed in to change notification settings - Fork 770
First code submission for MVC Pipeline #6749
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/mvc-pipeline
Are you sure you want to change the base?
Changes from all commits
96b3954
806a567
18dda02
2b93b83
e66429e
195b407
192a1fe
ed9dfad
0b39bb2
23b6b13
825ae25
26a4165
261a156
9ec0a3d
44c90c7
bcba2c6
6b1f317
4700236
af884e5
78bcb42
419c044
5e3b2d4
d17225a
e903cda
55308ab
e107bd4
c91f68a
09c4c04
4aae3e8
0fd3b47
2f322e0
bbe31c4
fbb2798
daca3d9
e9510a7
fcd1661
dbc02ce
35bffb5
6b7aada
a54636a
f59b679
271bc92
994abe6
4693637
b6275b9
f3dab1b
85dc08c
baaef7b
7125224
37b459b
14d32b3
3750061
87306d4
1dd392f
63ecbec
3876e96
2802019
a7520b8
09abe33
e1c419e
3e2dee6
2d44234
70ccbeb
2b4cd9e
269950d
fa00ff7
49d6628
10e6692
38615b3
9931d1c
8f9ec8e
bf50796
d8e2c23
2c7ae88
28a8578
26bbd90
a321c0d
6f44d1f
26b700a
a6d4027
9ab6e50
fdcde3a
ec3b710
d94ca80
c369e1e
df42015
4476348
ae00a15
863cbb7
7be534e
526412b
9ab7cae
fda5223
f6231bc
ee09648
626e5a0
e07308a
4a18e30
e007e36
a3d5c18
74b12d4
4bf447e
d89fbb8
0f32c9a
6a24f3a
567c571
b9fa629
039633e
ac6941f
f522728
12e1d64
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
|
|
||
| # .NET Development Rules | ||
|
|
||
| You are a senior .NET full stack developer and an expert in C#, ASP.NET Framework, ASP.NET Core, and ReactJS | ||
|
|
||
| ## This project | ||
|
|
||
| This is a CMS that runs on classic ASP.NET Framework (version 4.8). The default entry point is /default.aspx which can be found under /DNN Platform/Website. | ||
| We are building a new pipeline based on ASP.NET MVC with the goal of moving away from webforms and towards .NET Core. Right now we will create a hybrid solution | ||
| with two rendering mechanisms: the old webforms pipeline through default.aspx and a new pipeline through /DesktopModules/Default/Page/{tabId}/{locale}. This | ||
| should be picked up and handled in the DotNetNuke.Web.MvcPipeline library. The skin that is being loaded should decide which pipeline is being used to render a | ||
| page to the client. | ||
|
|
||
| ## Code Organization | ||
|
|
||
| We want to minimize any code changes to the existing project and concentrate as much as we can any code changes in the DotNetNuke.Web.MvcPipeline project. | ||
| If need be we can create more projects to house new code. | ||
|
|
||
| ## Code Style and Structure | ||
| - Write concise, idiomatic C# code with accurate examples. | ||
| - Follow .NET and ASP.NET Core conventions and best practices. | ||
| - Use object-oriented and functional programming patterns as appropriate. | ||
| - Prefer LINQ and lambda expressions for collection operations. | ||
| - Use descriptive variable and method names (e.g., 'IsUserSignedIn', 'CalculateTotal'). | ||
| - Structure files according to .NET conventions (Controllers, Models, Services, etc.). | ||
|
|
||
| ## Naming Conventions | ||
| - Follow guidelines from the stylecop.json file | ||
|
|
||
| ## C# and .NET Usage | ||
| - | ||
|
|
||
| ## Syntax and Formatting | ||
| - Use 'var' for implicit typing when the type is obvious. | ||
|
|
||
| ## Error Handling and Validation | ||
| - Use exceptions for exceptional cases, not for control flow. | ||
| - Implement proper error logging using built-in .NET logging or a third-party logger. | ||
| - Use Data Annotations or Fluent Validation for model validation. | ||
| - Implement global exception handling middleware. | ||
| - Return appropriate HTTP status codes and consistent error responses. | ||
|
|
||
| ## API Design | ||
| - Follow RESTful API design principles. | ||
| - Use attribute routing in controllers. | ||
| - Implement versioning for your API. | ||
| - Use action filters for cross-cutting concerns. | ||
|
|
||
| ## Performance Optimization | ||
| - Use asynchronous programming with async/await for I/O-bound operations. | ||
| - Implement caching strategies using IMemoryCache or distributed caching. | ||
| - Use efficient LINQ queries and avoid N+1 query problems. | ||
| - Implement pagination for large data sets. | ||
|
|
||
| ## Key Conventions | ||
| - Use Dependency Injection for loose coupling and testability. | ||
| - Implement repository pattern. | ||
| - Use AutoMapper for object-to-object mapping if needed. | ||
| - Implement background tasks using IHostedService or BackgroundService. | ||
|
|
||
| ## Testing | ||
| - Write unit tests using xUnit, NUnit, or MSTest. | ||
| - Use Moq or NSubstitute for mocking dependencies. | ||
| - Implement integration tests for API endpoints. | ||
|
|
||
| ## Security | ||
| - Implement proper CORS policies. | ||
|
|
||
| ## API Documentation | ||
| - Provide XML comments for controllers and models. | ||
|
|
||
| Follow the official Microsoft documentation and ASP.NET MVC guides for best practices in routing, controllers, models, and other API components. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
| // See the LICENSE file in the project root for more information | ||
| namespace DotNetNuke.Build.Tasks | ||
| { | ||
| using Cake.Frosting; | ||
|
|
||
| /// <summary>A cake task to compile the platform and create all of the packages.</summary> | ||
| /// <remarks>This is the task run during CI.</remarks> | ||
| [IsDependentOn(typeof(CleanArtifacts))] | ||
| [IsDependentOn(typeof(UpdateDnnManifests))] | ||
| [IsDependentOn(typeof(GenerateSecurityAnalyzerChecksums))] | ||
| [IsDependentOn(typeof(SetPackageVersions))] | ||
| [IsDependentOn(typeof(CreateInstall))] | ||
| [IsDependentOn(typeof(CreateUpgrade))] | ||
| [IsDependentOn(typeof(CreateNugetPackages))] | ||
| [IsDependentOn(typeof(GeneratePackagesChecksums))] | ||
| public sealed class BuildPackages : FrostingTask<Context> | ||
| { | ||
| /// <inheritdoc/> | ||
| public override void Run(Context context) | ||
| { | ||
| this.RevertSqlDataProvider(context); | ||
| } | ||
|
|
||
| private void RevertSqlDataProvider(Context context) | ||
| { | ||
| var fileName = context.GetTwoDigitsVersionNumber() + ".SqlDataProvider"; | ||
| var filePath = "./Dnn Platform/Website/Providers/DataProviders/SqlDataProvider/" + fileName; | ||
| if (!context.SqlDataProviderExists && System.IO.File.Exists(filePath)) | ||
| { | ||
| System.IO.File.Delete(filePath); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
| // See the LICENSE file in the project root for more information | ||
|
|
||
| namespace DotNetNuke.ContentSecurityPolicy | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this the same as the pending CSP PR into
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes it's the same. It need to be removed from here after the pr in develop is merged, so we can remerg it in this branch. |
||
| { | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text.RegularExpressions; | ||
|
|
||
| /// <summary> | ||
| /// Base class for all CSP directive contributors. | ||
| /// </summary> | ||
| public abstract class BaseCspContributor | ||
| { | ||
| /// <summary> | ||
| /// Gets unique identifier for the contributor. | ||
| /// </summary> | ||
| public Guid Id { get; } = Guid.NewGuid(); | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets type of the CSP directive. | ||
| /// </summary> | ||
| public CspDirectiveType DirectiveType { get; protected set; } | ||
|
|
||
| /// <summary> | ||
| /// Generates the directive string. | ||
| /// </summary> | ||
| /// <returns>The directive string.</returns> | ||
| public abstract string GenerateDirective(); | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose/goal of this task addition? I'm concerned that this will be deleting a source controlled file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@donker Can you answer this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry ... that is my code bleed. I can delete it. It just builds the packages. But I believe the "default" task also does this.