AdministradorSQL 1.0.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package AdministradorSQL --version 1.0.0.2                
NuGet\Install-Package AdministradorSQL -Version 1.0.0.2                
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="AdministradorSQL" Version="1.0.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AdministradorSQL --version 1.0.0.2                
#r "nuget: AdministradorSQL, 1.0.0.2"                
#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 AdministradorSQL as a Cake Addin
#addin nuget:?package=AdministradorSQL&version=1.0.0.2

// Install AdministradorSQL as a Cake Tool
#tool nuget:?package=AdministradorSQL&version=1.0.0.2                

INTRODUCCION

NAMESPACE NECESARIOS

 1.- using AdministradorSQL.Builders;
 2.- using AdministradorSQL.Interfaces;

CREACION DE CONEXION

 IConnectionBuilder _builder = new ConnectionBuilder();
 _builder.SetInfoConexion("YourServidor", "YourBD", "YourUser", "YourPassword");

CREACION DE CONSULTA SQL || STORE PROCEDURE

NOTA: LA DLL PUEDE MANDAR CLASES COMO OBJECTO GENERICO

CREACION DE CLASE

internal class Usuario
{
    public string Name { get; set; }
    public int Id { get; set; }
    public string Title { get; set; }
    public DateTime Created { get; set; }
}

CONSULTA SIMPLE

Usuario user = _builder.FirstOrDefaultQuery<Usuario>(@"SELECT Name, Id, Title, Created FROM Usuario");

CONSULTA CON PARAMETROS

Dictionary<string, object> parametros = new Dictionary<string, object>();
parametros.Add("@ID", 1);
user = _builder.FirstOrDefaultQuery<Usuario>(@"SELECT * FROM Usuario WHERE Id = @ID", parametros);

CONSULTA DE LISTA DE CLASE SIMPLE

List<Usuario> users = _builder.ToListStoreProcedure<Usuario>(@"SELECT Name, Id, Title, Created FROM Usuario").ToList();

CONSULTA DE LISTA DE CLASE CON PARAMETROS

users = _builder.ToListStoreProcedurFunc<Usuario>((lista) => new Usuario
{
    Name = lista.GetValue<string>("Name"),
    Id = lista.GetValue<int>("ID"),
    Created  = lista.GetValue<DateTime>("Created"),
    Title = lista.GetValue<string>("Title"),
}, @"SELECT * FROM Usuario WHERE Id = @ID", parametros).ToList();

CONTACTO

- skallivurtrower@gmail.com
Product Compatible and additional computed target framework versions.
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.8

    • 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.5 455 8/24/2022
1.0.0.4 403 8/18/2022
1.0.0.3 417 8/17/2022
1.0.0.2 376 8/17/2022
1.0.0.1 407 8/16/2022
1.0.0 409 8/15/2022

Summary of changes made in this release of the package.