EntityToSQL 1.0.0
dotnet add package EntityToSQL --version 1.0.0
NuGet\Install-Package EntityToSQL -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="EntityToSQL" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EntityToSQL --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EntityToSQL, 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 EntityToSQL as a Cake Addin
#addin nuget:?package=EntityToSQL&version=1.0.0
// Install EntityToSQL as a Cake Tool
#tool nuget:?package=EntityToSQL&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
EntityToSQL
Create a select query, an insert query, an update query or a delete query from a entity using custom attributes.
Minimum requirements
Framework 4.6.2
History
Version 1.0.0 (03/05/2024)<br> First version
Sample
Entity
[Table(Name = "Country", Schema = "")]
public class Country
{
[Column(DbType = System.Data.DbType.String, IsPrimaryKey = true, Name = "ID")]
public string ID { get; set; }
[Column(DbType = System.Data.DbType.Int32, IsPrimaryKey = true, Name = "ISO")]
public int ISO { get; set; }
[Column(DbType = System.Data.DbType.String, IsPrimaryKey = false, Name = "Name")]
public string Name { get; set; }
}
Country country = new Country
{
ID = "USA",
ISO = 840,
Name = "United States of America"
};
EntityToSQL.EntityToSQL<Country> toCountry = new EntityToSQL.EntityToSQL<Country>();
Console.WriteLine(toCountry.GetDelete(country));
Console.WriteLine(toCountry.GetUpdate(country));
Console.WriteLine(toCountry.GetUpdate(country, "ISO = 'FRA'"));
Console.WriteLine(toCountry.GetInsert(country));
Console.WriteLine(toCountry.GetSelect(country));
Results :
DELETE FROM Country WHERE ID = 'USA' AND ISO = 840
UPDATE Country SET ID = 'USA', ISO = '840', Name = 'United States of America' WHERE ID = 'USA' AND ISO = 840
UPDATE Country SET ID = 'USA', ISO = '840', Name = 'United States of America' WHERE ISO = 'FRA'
INSERT INTO Country (ID, ISO, Name) VALUES ('USA', 840, 'United States of America')
SELECT ID, ISO, Name FROM Country
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.6.2
- No dependencies.
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 | 46 | 5/3/2024 |