Skip to content

Commit c4f6a06

Browse files
Add ASP.NET Core Example & Update to Fluent (#4) (#5)
1 parent a76b068 commit c4f6a06

48 files changed

Lines changed: 7289 additions & 65 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,12 @@ TesterMetadata.xml
304304
# Backup files
305305
*.bak
306306

307-
*/wwwroot/*
307+
*/wwwroot/js/vendor.js
308+
!*/wwwroot/js
309+
!*/wwwroot/js/helpers
310+
!*/wwwroot/js/helpers/**
308311

312+
*/wwwroot/css/*
309313
!*/wwwroot/css/Site.css
314+
310315
*.DS_Store

ASP.NET Core/.editorconfig

Lines changed: 264 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,264 @@
1+
# Remove the line below if you want to inherit .editorconfig settings from higher directories
2+
root = true
3+
4+
# All files
5+
[*]
6+
indent_style = space
7+
indent_size = 4
8+
tab_width = 4
9+
charset = utf-8
10+
insert_final_newline = true
11+
end_of_line = lf
12+
trim_trailing_whitespace = true
13+
guidelines = 120
14+
15+
# C# files
16+
[*.cs]
17+
18+
#### .NET Coding Conventions ####
19+
20+
# Organize usings
21+
dotnet_separate_import_directive_groups = false
22+
dotnet_sort_system_directives_first = true
23+
file_header_template = unset
24+
25+
# this. and Me. preferences
26+
dotnet_style_qualification_for_event = false
27+
dotnet_style_qualification_for_field = false
28+
dotnet_style_qualification_for_method = false
29+
dotnet_style_qualification_for_property = false
30+
31+
# Language keywords vs BCL types preferences
32+
dotnet_style_predefined_type_for_locals_parameters_members = true
33+
dotnet_style_predefined_type_for_member_access = true
34+
35+
# Parentheses preferences
36+
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
37+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
38+
dotnet_style_parentheses_in_other_operators = never_if_unnecessary
39+
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity
40+
41+
# Modifier preferences
42+
dotnet_style_require_accessibility_modifiers = for_non_interface_members
43+
44+
# Expression-level preferences
45+
dotnet_style_coalesce_expression = true
46+
dotnet_style_collection_initializer = true
47+
dotnet_style_explicit_tuple_names = true
48+
dotnet_style_namespace_match_folder = false
49+
dotnet_style_null_propagation = true
50+
dotnet_style_object_initializer = true
51+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
52+
dotnet_style_prefer_auto_properties = true
53+
dotnet_style_prefer_compound_assignment = true
54+
dotnet_style_prefer_conditional_expression_over_assignment = true
55+
dotnet_style_prefer_conditional_expression_over_return = true
56+
dotnet_style_prefer_inferred_anonymous_type_member_names = true
57+
dotnet_style_prefer_inferred_tuple_names = true
58+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true
59+
dotnet_style_prefer_simplified_boolean_expressions = true
60+
dotnet_style_prefer_simplified_interpolation = true
61+
62+
# Field preferences
63+
dotnet_style_readonly_field = true
64+
65+
# Parameter preferences
66+
dotnet_code_quality_unused_parameters = all
67+
68+
# Suppression preferences
69+
dotnet_remove_unnecessary_suppression_exclusions = none
70+
dotnet_diagnostic.S1186.severity = none
71+
dotnet_diagnostic.S6602.severity = none
72+
dotnet_diagnostic.S6605.severity = none
73+
dotnet_diagnostic.S6608.severity = none
74+
dotnet_diagnostic.S2971.severity = none
75+
dotnet_diagnostic.S4136.severity = none
76+
dotnet_diagnostic.S1066.severity = none
77+
dotnet_diagnostic.S3358.severity = none
78+
dotnet_diagnostic.S6562.severity = none
79+
dotnet_diagnostic.S3267.severity = none
80+
dotnet_diagnostic.S6967.severity = none
81+
dotnet_diagnostic.S1121.severity = suggestion
82+
dotnet_diagnostic.S1144.severity = suggestion
83+
dotnet_diagnostic.S2325.severity = suggestion
84+
dotnet_diagnostic.S3963.severity = suggestion
85+
dotnet_diagnostic.CA1826.severity = none
86+
87+
# New line preferences
88+
dotnet_style_allow_multiple_blank_lines_experimental = true
89+
dotnet_style_allow_statement_immediately_after_block_experimental = true
90+
91+
#### C# Coding Conventions ####
92+
93+
# var preferences
94+
csharp_style_var_elsewhere = false
95+
csharp_style_var_for_built_in_types = false
96+
csharp_style_var_when_type_is_apparent = false
97+
98+
# Expression-bodied members
99+
csharp_style_expression_bodied_accessors =true:suggestion
100+
csharp_style_expression_bodied_constructors =false:silent
101+
csharp_style_expression_bodied_indexers =true:suggestion
102+
csharp_style_expression_bodied_lambdas =true:warning
103+
csharp_style_expression_bodied_local_functions =true:suggestion
104+
csharp_style_expression_bodied_methods =false:silent
105+
csharp_style_expression_bodied_operators =false:silent
106+
csharp_style_expression_bodied_properties =true:suggestion
107+
108+
# Pattern matching preferences
109+
csharp_style_pattern_matching_over_as_with_null_check = true
110+
csharp_style_pattern_matching_over_is_with_cast_check = true
111+
csharp_style_prefer_not_pattern = true
112+
csharp_style_prefer_pattern_matching =true:suggestion
113+
csharp_style_prefer_switch_expression = true
114+
115+
# Null-checking preferences
116+
csharp_style_conditional_delegate_call =true:warning
117+
118+
# Modifier preferences
119+
csharp_prefer_static_local_function = true
120+
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async
121+
122+
# Code-block preferences
123+
csharp_prefer_braces = true
124+
csharp_prefer_simple_using_statement = true
125+
csharp_style_namespace_declarations = file_scoped:suggestion
126+
127+
# Expression-level preferences
128+
csharp_prefer_simple_default_expression = true
129+
csharp_style_deconstructed_variable_declaration = true
130+
csharp_style_implicit_object_creation_when_type_is_apparent = true
131+
csharp_style_inlined_variable_declaration = true
132+
csharp_style_pattern_local_over_anonymous_function =true:silent
133+
csharp_style_prefer_index_operator = true
134+
csharp_style_prefer_range_operator = true
135+
csharp_style_throw_expression = true
136+
csharp_style_unused_value_assignment_preference = discard_variable
137+
csharp_style_unused_value_expression_statement_preference = discard_variable
138+
139+
# 'using' directive preferences
140+
csharp_using_directive_placement =outside_namespace:warning
141+
142+
# New line preferences
143+
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true
144+
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true
145+
csharp_style_allow_embedded_statements_on_same_line_experimental = true
146+
147+
#### C# Formatting Rules ####
148+
149+
# New line preferences
150+
csharp_new_line_before_catch = false
151+
csharp_new_line_before_else = false
152+
csharp_new_line_before_finally = false
153+
csharp_new_line_before_members_in_anonymous_types = true
154+
csharp_new_line_before_members_in_object_initializers = true
155+
csharp_new_line_before_open_brace = none
156+
csharp_new_line_between_query_expression_clauses = true
157+
158+
# Indentation preferences
159+
csharp_indent_block_contents = true
160+
csharp_indent_braces = false
161+
csharp_indent_case_contents = true
162+
csharp_indent_case_contents_when_block = true
163+
csharp_indent_labels = no_change
164+
csharp_indent_switch_labels = true
165+
166+
# Space preferences
167+
csharp_space_after_cast = false
168+
csharp_space_after_colon_in_inheritance_clause = true
169+
csharp_space_after_comma = true
170+
csharp_space_after_dot = false
171+
csharp_space_after_keywords_in_control_flow_statements = false
172+
csharp_space_after_semicolon_in_for_statement = true
173+
csharp_space_around_binary_operators = before_and_after
174+
csharp_space_around_declaration_statements = false
175+
csharp_space_before_colon_in_inheritance_clause = false
176+
csharp_space_before_comma = false
177+
csharp_space_before_dot = false
178+
csharp_space_before_open_square_brackets = false
179+
csharp_space_before_semicolon_in_for_statement = false
180+
csharp_space_between_empty_square_brackets = false
181+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
182+
csharp_space_between_method_call_name_and_opening_parenthesis = false
183+
csharp_space_between_method_call_parameter_list_parentheses = false
184+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
185+
csharp_space_between_method_declaration_name_and_open_parenthesis = false
186+
csharp_space_between_method_declaration_parameter_list_parentheses = false
187+
csharp_space_between_parentheses = false
188+
csharp_space_between_square_brackets = false
189+
190+
# Wrapping preferences
191+
csharp_preserve_single_line_blocks = true
192+
csharp_preserve_single_line_statements = true
193+
194+
#### Naming styles ####
195+
196+
# Naming rules
197+
198+
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
199+
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
200+
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
201+
202+
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
203+
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
204+
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
205+
206+
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
207+
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
208+
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
209+
210+
# Symbol specifications
211+
212+
dotnet_naming_symbols.interface.applicable_kinds = interface
213+
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
214+
dotnet_naming_symbols.interface.required_modifiers =
215+
216+
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
217+
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
218+
dotnet_naming_symbols.types.required_modifiers =
219+
220+
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
221+
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
222+
dotnet_naming_symbols.non_field_members.required_modifiers =
223+
224+
# Naming styles
225+
226+
dotnet_naming_style.pascal_case.required_prefix =
227+
dotnet_naming_style.pascal_case.required_suffix =
228+
dotnet_naming_style.pascal_case.word_separator =
229+
dotnet_naming_style.pascal_case.capitalization = pascal_case
230+
231+
dotnet_naming_style.begins_with_i.required_prefix = I
232+
dotnet_naming_style.begins_with_i.required_suffix =
233+
dotnet_naming_style.begins_with_i.word_separator =
234+
dotnet_naming_style.begins_with_i.capitalization = pascal_case
235+
236+
# IDE0290 Use primary constructor
237+
dotnet_diagnostic.IDE0290.severity = none
238+
239+
[*.{cs,vb}]
240+
dotnet_style_prefer_conditional_expression_over_assignment=true:suggestion
241+
dotnet_style_prefer_conditional_expression_over_return=true:suggestion
242+
dotnet_style_readonly_field=true:warning
243+
dotnet_style_predefined_type_for_locals_parameters_members=true:warning
244+
dotnet_style_parentheses_in_arithmetic_binary_operators=always_for_clarity:warning
245+
dotnet_style_parentheses_in_other_binary_operators=always_for_clarity:warning
246+
dotnet_style_parentheses_in_relational_binary_operators=always_for_clarity:warning
247+
dotnet_style_qualification_for_field=false:suggestion
248+
dotnet_style_qualification_for_property=false:suggestion
249+
dotnet_style_qualification_for_method=false:suggestion
250+
dotnet_style_qualification_for_event=false:suggestion
251+
252+
[*.{json,eslintrc,xml,config}]
253+
indent_size = 2
254+
tab_width = 2
255+
256+
[*.sh]
257+
end_of_line = lf
258+
259+
[*.{bat,cmd,sln}]
260+
end_of_line = crlf
261+
262+
[*.{*proj}]
263+
indent_size = 2
264+
tab_width = 2

ASP.NET Core/ASP.NET Core.csproj

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<SpaRoot>$(MSBuildProjectDirectory)\</SpaRoot>
6+
</PropertyGroup>
7+
8+
<Target Name="DebugEnsureNodeEnv" BeforeTargets="BeforeBuild" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') ">
9+
<!-- Ensure Node.js is installed -->
10+
<Exec Command="node --version" ContinueOnError="true">
11+
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
12+
</Exec>
13+
<Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE." />
14+
<Message Importance="high" Text="Restoring dependencies using 'npm'. This may take several minutes..." />
15+
<Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
16+
</Target>
17+
<Target Name="RunGulp" BeforeTargets="BeforeBuild" Condition=" '$(Configuration)' == 'Debug' And Exists('$(SpaRoot)node_modules') ">
18+
<Exec WorkingDirectory="$(ProjectDir)" Command="node_modules\.bin\gulp add-resources" ContinueOnError="false">
19+
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
20+
</Exec>
21+
</Target>
22+
23+
<ItemGroup>
24+
<PackageReference Include="DevExtreme.AspNet.Core" Version="26.1.*" />
25+
</ItemGroup>
26+
27+
</Project>

ASP.NET Core/ASP.NET Core.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.30330.147
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ASP.NET Core", "ASP.NET Core.csproj", "{435CB7A8-3168-4BD2-815F-E54F708AF968}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{435CB7A8-3168-4BD2-815F-E54F708AF968}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{435CB7A8-3168-4BD2-815F-E54F708AF968}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{435CB7A8-3168-4BD2-815F-E54F708AF968}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{435CB7A8-3168-4BD2-815F-E54F708AF968}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {08AFB133-D1F6-4FE9-A66A-586B96B002D0}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using ASP_NET_Core.Models;
2+
using DevExtreme.AspNet.Data;
3+
using DevExtreme.AspNet.Mvc;
4+
using Microsoft.AspNetCore.Mvc;
5+
6+
namespace ASP_NET_Core.Controllers;
7+
8+
public class EmployeeDataController : Controller {
9+
10+
[HttpGet]
11+
public object Get(DataSourceLoadOptions loadOptions) {
12+
return DataSourceLoader.Load(EmployeeData.Employees, loadOptions);
13+
}
14+
15+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Microsoft.AspNetCore.Mvc;
6+
7+
namespace ASP_NET_Core.Controllers;
8+
public class HomeController: Controller {
9+
public IActionResult Index() {
10+
return View();
11+
}
12+
13+
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
14+
public IActionResult Error() {
15+
return View();
16+
}
17+
}

ASP.NET Core/Models/Employee.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace ASP_NET_Core.Models;
8+
public class Employee {
9+
public int EmployeeID { get; set; }
10+
public string FullName { get; set; }
11+
public string Position { get; set; }
12+
public string TitleOfCourtesy { get; set; }
13+
public string BirthDate { get; set; }
14+
public string HireDate { get; set; }
15+
public string Address { get; set; }
16+
public string City { get; set; }
17+
public string Region { get; set; }
18+
public string PostalCode { get; set; }
19+
public string Country { get; set; }
20+
public string HomePhone { get; set; }
21+
public string Extension { get; set; }
22+
public string Photo { get; set; }
23+
public string Notes { get; set; }
24+
public int? ReportsTo { get; set; }
25+
}

0 commit comments

Comments
 (0)