-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsamples.html
180 lines (167 loc) · 10.4 KB
/
samples.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Sample applications | DVML </title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="Sample applications | DVML ">
<meta name="generator" content="docfx 2.52.0.0">
<link rel="shortcut icon" href="images/fas/fa-stream/stream-solid-gray.svg">
<link rel="stylesheet" href="styles/docfx.vendor.css">
<link rel="stylesheet" href="styles/docfx.css">
<link rel="stylesheet" href="styles/main.css">
<link rel="stylesheet" href="styles/fontawesome.min.css">
<meta property="docfx:navrel" content="toc">
<meta property="docfx:tocrel" content="toc">
<meta property="docfx:rel" content="">
<meta property="docfx:newtab" content="true">
</head>
<body data-spy="scroll" data-target="#affix" data-offset="120">
<div id="wrapper">
<header>
<nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">
<img id="logo" class="svg logo" src="images/logo-128.png" alt="">
</a>
</div>
<div class="collapse navbar-collapse" id="navbar">
<form class="navbar-form navbar-right" role="search" id="search">
<div class="form-group">
<input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
</div>
</form>
<ul class="nav level1 navbar-nav">
<li>
<a href="index.html" title="Introduction">Introduction</a>
</li>
<li>
<a href="api/DynamicVML.html" title="API Documentation">API Documentation</a>
</li>
<li>
<a href="samples.html" title="Sample Apps">Sample Apps</a>
</li>
<li>
<a href="https://github.com/dynamic-vml/dvml" title="GitHub">GitHub</a>
</li>
</ul> </div>
</div>
</nav>
<div class="subnav navbar navbar-default">
<div class="container hide-when-search" id="breadcrumb">
<ul class="breadcrumb">
<li></li>
</ul>
</div>
</div>
</header>
<div class="container body-content">
<div id="search-results">
<div class="search-list"></div>
<div class="sr-items">
<p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
</div>
<ul id="pagination"></ul>
</div>
</div>
<div role="main" class="container body-content hide-when-search">
<div class="article row grid">
<div class="col-md-10">
<article class="content wrap" id="_content" data-uid="">
<h1 id="sample-applications">Sample applications</h1>
<p>You can find sample applications on the project's <a href="https://github.com/dynamic-vml/">GitHub page</a> which can help
demonstrate how this library can be used. Those are:</p>
<h3 id="books-and-authors">Books and authors</h3>
<ul>
<li>Browse the source: <a href="https://github.com/dynamic-vml/sample-netcoreapp3.1-books-and-authors-simple">dynamic-vml/sample-netcoreapp3.1-books-and-authors-simple</a></li>
<li>Download it as a .zip: <a href="https://github.com/dynamic-vml/sample-netcoreapp3.1-books-and-authors-simple/archive/master.zip">master.zip</a></li>
</ul>
<p>This sample application <a href="https://github.com/dynamic-vml/sample-netcoreapp3.1-books-and-authors-simple/blob/master/Controllers/AuthorsController.cs#L56">demonstrates</a> how to consume the DynamicVML RCL from a .NET Core App 3.1 application
running ASP.NET MVC for presentation and Entity Framework Core for persistence. It consists of a simple CRUD
example where you can list, add, edit, and delete book authors and include details about the books they have
written. The books are added and removed from the CRUD pages using DynamicVML.</p>
<h3 id="books-and-authors-customized-layouts">Books and authors (customized layouts)</h3>
<ul>
<li>Browse the source: <a href="https://github.com/dynamic-vml/sample-netcoreapp3.1-books-and-authors-options">dynamic-vml/sample-netcoreapp3.1-books-and-authors-options</a></li>
<li>Download it as a .zip: <a href="https://github.com/dynamic-vml/sample-netcoreapp3.1-books-and-authors-options/archive/master.zip">master.zip</a></li>
</ul>
<p>This version of the sample application shows <a href="https://github.com/dynamic-vml/sample-netcoreapp3.1-books-and-authors-options/blob/master/Views/Authors/Create.cshtml#L30">how to customize</a>
the <a href="https://github.com/dynamic-vml/sample-netcoreapp3.1-books-and-authors-options/blob/master/Views/Authors/EditorTemplates/CustomItemTemplateWithMyOptions.cshtml">layouts of the lists</a> and how to create <a href="https://github.com/dynamic-vml/sample-netcoreapp3.1-books-and-authors-options/blob/master/ViewModels/MyOptions.cs">view
models for display options</a>
associated with each item in a list, e.g., titles and subtitles for <a href="https://getbootstrap.com/docs/4.0/components/card/">Bootstrap Cards</a>.</p>
<h3 id="books-and-authors-parameterized-templates">Books and authors (parameterized templates)</h3>
<ul>
<li>Browse the source: <a href="https://github.com/dynamic-vml/sample-netcoreapp3.1-books-and-authors-parameters">dynamic-vml/sample-netcoreapp3.1-books-and-authors-parameters</a></li>
<li>Download it as a .zip: <a href="https://github.com/dynamic-vml/sample-netcoreapp3.1-books-and-authors-parameters/archive/master.zip">master.zip</a></li>
</ul>
<p>This version of the sample application shows how to <a href="https://github.com/dynamic-vml/sample-netcoreapp3.1-books-and-authors-parameters/blob/master/Views/Authors/EditorTemplates/CustomItemTemplateWithMyOptions.cshtml">create parameterized templates</a> that can have their behaviour
customized depending on <a href="https://github.com/dynamic-vml/sample-netcoreapp3.1-books-and-authors-parameters/blob/master/Views/Authors/Create.cshtml#L38">additional view data</a> specified inside the view (.cshtml). This sample also shows how to
make the user request new items to be added to the list <a href="https://github.com/dynamic-vml/sample-netcoreapp3.1-books-and-authors-parameters/blob/master/Controllers/AuthorsController.cs#L79">via POST</a>.</p>
<h1 id="razor-class-libraries-rcl">Razor Class Libraries (RCL)</h1>
<p>Those examples, together with the
<a href="https://github.com/dynamic-mvl/dvml">library iself</a>,
can also serve as an example on how to create a reusable
<a href="https://docs.microsoft.com/en-us/aspnet/core/blazor/class-libraries?view=aspnetcore-3.1&tabs=visual-studio">Razor Class Library</a>
(RCL) that contain
<a href="https://docs.microsoft.com/en-us/aspnet/core/fundamentals/static-files?view=aspnetcore-3.1">static resources</a>
and how to consume it from your applications in .NET Core 3.1. There is
<a href="https://stackoverflow.com/questions/59431923/cant-reference-static-files-from-rcl">currently</a>
<a href="https://stackoverflow.com/questions/51610513/can-razor-class-library-pack-static-files-js-css-etc-too?rq=1">some</a>
<a href="https://stackoverflow.com/questions/60040793/404-with-static-content-in-razor-class-library-rcl">confusion</a>
on how to achieve this due the significant amount of
<a href="https://dotnetstories.com/blog/How-to-Include-static-files-in-a-Razor-library-en-7156675136">outdated</a>
<a href="https://www.learnrazorpages.com/advanced/razor-class-library">tutorials</a> and
<a href="https://stackoverflow.com/a/53241012/262032">Stackoverflow answers</a> out there.</p>
<ul>
<li>Here is the <a href="https://github.com/dynamic-vml/dvml/blob/master/src/DynamicVML.csproj">.csproj configuration for the library</a>.</li>
<li>Here are the <a href="https://github.com/dynamic-vml/sample-netcoreapp3.1-books-and-authors-simple/blob/master/Program.cs">Program.cs</a>
and <a href="https://github.com/dynamic-vml/sample-netcoreapp3.1-books-and-authors-simple/blob/master/Startup.cs">Startup.cs</a> for the consumer applications.</li>
</ul>
<div class="TIP"><h5>Tip</h5><p>Never use the <a href="https://www.nuget.org/downloads">standalone nuget.exe</a>
to pack Razor libraries. Always use <a href="https://docs.microsoft.com/en-us/nuget/reference/dotnet-commands">dotnet nuget pack</a>
instead. They are completely different beasts.</p>
</div>
</article>
</div>
<div class="hidden-sm col-md-2" role="complementary">
<div class="sideaffix">
<div class="contribution">
<ul class="nav">
<li>
<a href="https://github.com/dynamic-vml/dvml/blob/master/docs/samples.md/#L1" class="contribution-link">Improve this Doc</a>
</li>
</ul>
</div>
<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
<!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
</nav>
</div>
</div>
</div>
</div>
<footer>
<div class="grad-bottom"></div>
<div class="footer">
<div class="container">
<span class="pull-right">
<a href="#top">Back to top</a>
</span>
Copyright © 2020 César Roberto de Souza - All files are available under the <a href="https://opensource.org/licenses/MIT">MIT license</a> except the logo, which comes from <a href="https://fontawesome.com/">FontAwesome.
</a></div>
</div>
</footer>
</div>
<script type="text/javascript" src="styles/docfx.vendor.js"></script>
<script type="text/javascript" src="styles/docfx.js"></script>
<script type="text/javascript" src="styles/main.js"></script>
</body>
</html>