This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Logging": { | |
"LogLevel": { | |
"Default": "Information", | |
"Microsoft": "Warning", | |
"Microsoft.Hosting.Lifetime": "Information" | |
} | |
}, | |
"AllowedHosts": "*", | |
"RedisSettings": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void ConfigureServices(IServiceCollection services) | |
{ | |
var settings = configuration.GetSection(SectionNames.RedisSettings).Get<RedisSettings>(); | |
services.AddDistributedRedisCache(option => | |
{ | |
option.Configuration = settings.Uri; | |
option.InstanceName = settings.Instance; | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private IConfiguration Configuration { get; } | |
private readonly ILogger<CachingService> logger; | |
public CachingService(IConfiguration configuration,ILogger<CachingService> logger) | |
{ | |
Configuration = configuration; | |
this.logger = logger; | |
} | |
private RedisCacheProviderStatus ServiceStatus() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task<IEnumerable<Sample>> GetAll() | |
{ | |
if (cachingService.Exists(CacheKey.Samples)) | |
{ | |
return cachingService.Get<IEnumerable<Sample>>(CacheKey.Samples); | |
} | |
var list = await repository.GetAllAsync(); | |
cachingService.Set(CacheKey.Samples, samples.ToList()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"outputFileName": "wwwroot/bundles/css/main.css", | |
"inputFiles": [ | |
"wwwroot/lib/bootstrap/dist/css/bootstrap.css", | |
"wwwroot/css/site.css", | |
"wwwroot/lib/sweetalert/sweetalert2.css", | |
"wwwroot/lib/datatables/datatables.css" | |
] | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddControllers(); | |
services.AddSwaggerGen(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) | |
{ | |
if (env.IsDevelopment()) | |
{ | |
app.UseDeveloperExceptionPage(); | |
} | |
app.UseSwagger(); | |
app.UseSwaggerUI(c => | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://json.schemastore.org/launchsettings.json", | |
"profiles": { | |
"WebApi": { | |
"commandName": "Project", | |
"launchBrowser": true, | |
"launchUrl": "swagger", | |
"applicationUrl": "https://localhost:5001;http://localhost:5000", | |
"environmentVariables": { | |
"ASPNETCORE_ENVIRONMENT": "Development" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services.AddSwaggerGen(c => | |
{ | |
c.SwaggerDoc("v1", new OpenApiInfo | |
{ | |
Version = "v1", | |
Title = "WebApiSwagger", | |
Description = "Sample ASP.NET Core Web API Swagger implementation", | |
Contact = new OpenApiContact | |
{ | |
Name = "Umay ERAS", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services.AddSwaggerGen(c => | |
{ | |
c.SwaggerDoc("v1", new OpenApiInfo | |
{ | |
Version = "v1", | |
Title = "Web Api Swagger", | |
Description = "Sample ASP.NET Core Web API Swagger implementation", | |
Contact = new OpenApiContact | |
{ | |
Name = "Umay ERAS", |
OlderNewer