You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Robin Thoni e2f730e0af v0.4.0 7 years ago
..
Business made all curd methods virtual 7 years ago
Controllers using Configure method for LuUtilsOptions; added transactions to LuEfDataAccess; updated readme; tests 7 years ago
DataAccess changed DbSet to IQueryable 7 years ago
Dbo fixed LuFilterDbo; tests; added filters in pkguid 7 years ago
Hubs added dbo in notifications filters; made hub connection tracker thread safe 7 years ago
Interfaces removed unused imports; added someText check; fixed crud business null check 7 years ago
Middlewares using Configure method for LuUtilsOptions; added transactions to LuEfDataAccess; updated readme; tests 7 years ago
Properties init 8 years ago
Utils added dbo/model conversion tools; added add/edit hooks; tests 7 years ago
Luticate2.Utils.xproj init 8 years ago
README.md using Configure method for LuUtilsOptions; added transactions to LuEfDataAccess; updated readme; tests 7 years ago
project.json v0.4.0 7 years ago

README.md

Luticate2 API Utils

Install

NuGet.Config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
    <add key="rthoni" value="http://nuget.rthoni.com" protocolVersion="2" />
  </packageSources>
</configuration>

project.json

{
    ...
    dependencies": {
        "Luticate2.Utils": "0.1.*",
        ...
    }
    ...
}

appsettings.json

{
    ...
    "ConnectionStrings": {
        "default":  "User ID=POSTGRES_USER;Password=POSTGRES_PASSWORD;Host=POSTGRES_HOST;Port=5432;Database=POSTGRES_DB;Pooling=true;",
        ...
    }
    ...
}

Startup.cs

public void ConfigureServices(IServiceCollection services)
{
    // ...

    // MUST be before addMvc()
    services.AddLuticateUtils(options => options.Version = "dev");

    // ...
    
    //The data access classes using YourDbContext need to be added as scoped
    services.AddDbContext<YourDbContext>(options => // Replace YourDbContext with your own database context
    {
        options.UseNpgsql(Configuration.GetConnectionString("default"));
        options.UseInternalServiceProvider(new ServiceCollection()
            .AddEntityFrameworkNpgsqlLuticate() // MUST be before AddEntityFrameworkNpgsql()
            .AddEntityFrameworkNpgsql()
            .BuildServiceProvider());
    }, ServiceLifetime.Transient);

    services.AddMvc()
        .AddLuticateUtils();
        
    // ...
}

public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
    // ...

    // MUST be before useMvc()
    app.UseLuticateUtils();

    // ...
}

Usage

See WebApiUtils for an example

NuGet Deployment

  • Set version in project.json

  • Build package: dotnet pack --configuration Release

  • Deploy package: nuget push -Source http://nuget.rthoni.com bin/Release/Luticate2.Utils.VERSION.nupkg