EZCRUD 1.0.0
dotnet add package EZCRUD --version 1.0.0
NuGet\Install-Package EZCRUD -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EZCRUD" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EZCRUD --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EZCRUD, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install EZCRUD as a Cake Addin #addin nuget:?package=EZCRUD&version=1.0.0 // Install EZCRUD as a Cake Tool #tool nuget:?package=EZCRUD&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
EZCRUD
EZCRUD provides a simple means to interact with a SQL Server database.
How to implement:
- Add EZCRUD reference to your model library.
- For each model, inherit Model_RecordBase.
- Set EZCRUD's connection string ("DBAccess.DBSettings.ConnectionString = <yourConnectionString>" in your Startup.cs.
Available methods:
Example: Adds a new record to the "User" table with a FirstName of "John" and LastName of "Doe".
var userRecord = new User();
userRecord.FirstName = "John";
userRecord.LastName = "Doe";
bool result = userRecord.AddRecord();
- <yourModel>.AddRecord(); // adds the current model instance as a new record in the database.
Example: Loads the first record from the "Order" table that matches the given where clause and updates it.
var orderRecord = new Order();
bool loadSuccess = orderRecord.LoadRecordWhere("OrderedBy = 'John Doe'")';
if (loadSuccess)
orderRecord.OrderedBy = "Phil Jenkins";
bool updateResult = orderRecord.UpdateRecord();
- <yourModel>.UpdateRecord(); // updates the database table with the matching ID.
Example: Loads a "User" record with the ID of '4' and deletes it.
var user = new User();
bool loadSuccess = user.LoadRecord(4);
if (loadSuccess)
bool deleteSuccess = user.DeleteRecord();
- <yourModel>.DeleteRecord(); // deletes the database table with the matching ID.
Example: Retrieves all records from the "User" table and converts it into a list from a collection.
var userCollection = new User().SelectAll();
List<User> lstUsers = userCollection.ToModelList<User>();
- <yourModel>.SelectAll(); // returns all records, of the current model type, from the database. Equivalent to: SELECT * FROM <yourModelType>
Example: Retrieves all records from the "User" table that meets the given where clause, and converts it into a list from a collection inline.
List<User> lstUsers = new User().SelectWhereOrderBy("UserGroup = 'Managers'", "ID_User DESC").ToModelList<User>();
- <yourModel>.SelectWhereOrderBy(optional sWhere/sOrderBy); // returns an arbitrary set of records that matches the provided where phrase. Equivalent to: SELECT * FROM <Table> WHERE <sWhere> ORDER BY <sOrderBy>
Example: Retrieves the "User" record with an ID of '3' and populates the current "User" instance called "usr" using the retrieved data.
var usr = new User();
bool loadSuccess = usr.LoadRecord(3);
- <yourModel>.LoadRecord(id); // loads the record from the database table with the matching id and populates the current model instance using the retreived data.
Example: Retrieves the "User" record with a FirstName of "John" and populates the current "User" instance called "usr" using the retrieved data.
var usr = new User();
bool loadSuccess = usr.LoadRecordWhere("FirstName = 'John'");
- <yourModel>.LoadRecordWhere(sWhere); // loads the record from the database table that meets the where phrase criteria and populates the current model instance using the retreived data.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.1
- Microsoft.CSharp (>= 4.7.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 3.1.5)
- System.ComponentModel.Annotations (>= 4.7.0)
- System.Data.SqlClient (>= 4.8.1)
- System.Runtime (>= 4.3.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 6,202 | 7/18/2020 |
Initial release.