You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Any collection class of type <code>IEnumerable</code> or <code>IQueryable</code> that uses the <code>DevNet\System\MethodTrait</code> to support the extension method can take advantage of using LINQ extension methods.
15
15
</p>
16
16
<p>
17
-
The difference between <code>IEnumerable</code> and <code>IQueryable</code> types is that the implementation of the <code>IEnumerable</code> type, like the <code>ArrayList</code>, uses LINQ against in-memory data, while the implementation of the <code>IQueryable</code> type, like the <code>EntitySet</code> repository of DevNet Entity ORM, uses LINQ against SQL database, which means that this one uses <code>IQueryProvider</code> to compile the predicate expressions of the LINQ methods to SQL query syntax.
17
+
The difference between <code>IEnumerable</code> and <code>IQueryable</code> types is that the implementation of the <code>IEnumerable</code> type, like the <code>ArrayList</code>, uses LINQ against in-memory data, while the implementation of the <code>IQueryable</code> type, like the <code>EntitySet</code> repository of DevNet DevNet ORM, uses LINQ against SQL database, which means that this one uses <code>IQueryProvider</code> to compile the predicate expressions of the LINQ methods to SQL query syntax.
Copy file name to clipboardExpand all lines: src/app/core/overview/overview.component.html
+4-3Lines changed: 4 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@
8
8
<h1>Overview</h1>
9
9
<hr>
10
10
<p>
11
-
DevNet Core is the heart of the DevNet framework, and all of its components rely on it. It is a base class library that provides several fundamental features that make it easier to develop applications in PHP. These features include:
11
+
DevNet System is a low-level library that provides the fundamental functionalities of the DevNet framework, which can be represented in the following features:
12
12
</p>
13
13
<ul>
14
14
<li>Accessor Properties</li>
@@ -17,14 +17,15 @@ <h1>Overview</h1>
17
17
<li>Generic Types</li>
18
18
<li>Asynchronous Operations</li>
19
19
<li>Delegates & Events</li>
20
+
<li>Database Access</li>
20
21
<li>And more...</li>
21
22
</ul>
22
23
<br>
23
24
<h3>Installation</h3>
24
25
<p>
25
-
If you have installed any of the DevNet packages in your system or project, then you already have the DevNet Core. However, you can still install DevNet Core as a third-party library to work with any PHP project by running the following command in the terminal using composer:
26
+
If you have installed any of the DevNet packages, then you already have the DevNet System. However, you can still install DevNet System as a third-party library to work with any PHP project by running the following composer command-line:
Copy file name to clipboardExpand all lines: src/app/entity/relationships/relationships.component.html
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ <h3>Navigation property:</h3>
20
20
</p>
21
21
<ul>
22
22
<liclass="mb-2"><b>Collection navigation property:</b> is a property that contains references to multiple related entities, used to navigate through one-to-many and many-to-many relationships, defined by the type <code>DevNet\System\Collections\ICollection</code> with the annotation <code>DevNet\System\Generic</code> which specifies the type of the related entity collection.</li>
23
-
<liclass="mb-2"><b>Reference navigation property:</b> is a property that contains a reference to a single related entity, used to navigate through one-to-one and many-to-one relationships, has the same type as the type of the related entity, and may have the annotation <code>DevNet\Entity\Annotations\ForeignKey</code> to define the name of the property that is used as a foreign key in the dependent entity.</li>
23
+
<liclass="mb-2"><b>Reference navigation property:</b> is a property that contains a reference to a single related entity, used to navigate through one-to-one and many-to-one relationships, has the same type as the type of the related entity, and may have the annotation <code>DevNet\ORM\Annotations\ForeignKey</code> to define the name of the property that is used as a foreign key in the dependent entity.</li>
24
24
</ul>
25
25
<p>
26
26
The example below demonstrates an entity class named <code>Post</code> that has two navigation properties: a reference property called <code>Post::User</code>, and a collection property called <code>Post::Classifications</code>.
Copy file name to clipboardExpand all lines: src/app/entity/start/start.component.html
+25-25Lines changed: 25 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -8,10 +8,10 @@
8
8
<h1>Get Started</h1>
9
9
<hr>
10
10
<p>
11
-
Entity ORM (Object-relational Mapping) is a system that offers an automated mechanism to developers for accessing and storing the data in the database in an object-oriented way, by performing the work required to map between Entities defined in an application's programming language as classes and data stored in relational data sources as tables, without needing the data-access code to be written.
11
+
DevNet ORM (Object-relational Mapping) is a system that offers an automated mechanism to developers for accessing and storing the data in the database in an object-oriented way, by performing the work required to map between Entities defined in an application's programming language as classes and data stored in relational data sources as tables, without needing the data-access code to be written.
12
12
</p>
13
13
<p>
14
-
The following diagram is an abstraction of Entity ORM architecture.
14
+
The following diagram is an abstraction of DevNet ORM architecture.
If the DevNet framework is not fully installed, you can install the Entity ORM package into your project using Composer by running the following command in your terminal:
35
+
If the DevNet framework is not fully installed, you can install the DevNet ORM package into your project using Composer by running the following command in your terminal:
The recommended way to work with Entity ORM is to define a context class in the <b>"Models"</b> folder that derives from <code>DevNet\Entity\EntityContext</code> and exposes <code>DevNet\Entity\EntitySet</code> properties that represent collections of the specified entities in the context, as shown in the following example.
41
+
The recommended way to work with DevNet ORM is to define a context class in the <b>"Models"</b> folder that derives from <code>DevNet\ORM\EntityContext</code> and exposes <code>DevNet\ORM\EntitySet</code> properties that represent collections of the specified entities in the context, as shown in the following example.
42
42
</p>
43
43
<pre><codeclass="language-php"><?php
44
44
45
45
namespace Application\Models;
46
46
47
-
use DevNet\Entity\EntityContext;
48
-
use DevNet\Entity\EntityOptions;
49
-
use DevNet\Entity\EntitySet;
47
+
use DevNet\ORM\EntityContext;
48
+
use DevNet\ORM\EntityOptions;
49
+
use DevNet\ORM\EntitySet;
50
50
51
51
class BlogContext extends EntityContext
52
52
{
53
-
public readonly EntitySet $Posts;
53
+
public EntitySet $Posts;
54
54
55
55
public function __construct(EntityOptions $options)
56
56
{
@@ -105,9 +105,9 @@ <h4>Data annotations</h4>
105
105
106
106
namespace Application\Models;
107
107
108
-
use DevNet\Entity\Annotations\Column;
109
-
use DevNet\Entity\Annotations\Primarykey;
110
-
use DevNet\Entity\Annotations\Table;
108
+
use DevNet\ORM\Annotations\Column;
109
+
use DevNet\ORM\Annotations\Primarykey;
110
+
use DevNet\ORM\Annotations\Table;
111
111
use DateTime;
112
112
113
113
#[Table('Posts')]
@@ -133,13 +133,13 @@ <h4>Data annotations</h4>
133
133
<br>
134
134
<h3>Connecting to the Database</h3>
135
135
<p>
136
-
The simplest way to connect Entity ORM to the database, is by creating an instance of the derived class of <code>EntityContext</code>, and passing the database configuration options to the constructor as follows:
136
+
The simplest way to connect DevNet ORM to the database, is by creating an instance of the derived class of <code>EntityContext</code>, and passing the database configuration options to the constructor as follows:
It is recommended that you register the Entity ORM as a reusable service to be injected into your application using the <code>ServiceCollectionExtensions::addEntityContext()</code> Extension method, which is called within the <code>WebHostBuilder::register()</code> method, with the use of the configuration provider that gets the database configuration from the <samp>"settings.json"</samp> file as shown in the following code example:
190
+
It is recommended that you register the DevNet ORM as a reusable service to be injected into your application using the <code>ServiceCollectionExtensions::addEntityContext()</code> Extension method, which is called within the <code>WebHostBuilder::register()</code> method, with the use of the configuration provider that gets the database configuration from the <samp>"settings.json"</samp> file as shown in the following code example:
191
191
</p>
192
192
<pre><codeclass="language-php"><?php
193
193
194
194
namespace Application;
195
195
196
196
use Application\Models\BlogContext;
197
-
use DevNet\Web\Hosting\WebHost;
198
-
use DevNet\Web\Extensions\ApplicationBuilderExtensions;
199
-
use DevNet\Web\Extensions\ServiceCollectionExtensions;
197
+
use DevNet\Core\Hosting\WebHost;
198
+
use DevNet\Core\Extensions\ApplicationBuilderExtensions;
199
+
use DevNet\Core\Extensions\ServiceCollectionExtensions;
200
200
201
201
class Program
202
202
{
@@ -232,9 +232,9 @@ <h3>Registering the EntityContext</h3>
0 commit comments