Remove unnecesary comments and review settings

This commit is contained in:
Unai 2016-11-14 15:48:30 +01:00
parent cfd1a37fba
commit 3e001b40f0
5 changed files with 11 additions and 20 deletions

View File

@ -29,6 +29,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.Controllers
.LongCountAsync(); .LongCountAsync();
var itemsOnPage = await _context.CatalogItems var itemsOnPage = await _context.CatalogItems
.OrderBy(c=>c.Name)
.Skip(pageSize * pageIndex) .Skip(pageSize * pageIndex)
.Take(pageSize) .Take(pageSize)
.ToListAsync(); .ToListAsync();

View File

@ -17,8 +17,10 @@
{ {
var builder = new ConfigurationBuilder() var builder = new ConfigurationBuilder()
.SetBasePath(env.ContentRootPath) .SetBasePath(env.ContentRootPath)
.AddJsonFile($"settings.{env.EnvironmentName}.json", optional: false) .AddJsonFile($"settings.json", optional: false, reloadOnChange: true)
.AddEnvironmentVariables(); .AddJsonFile($"settings.{env.EnvironmentName}.json", optional: true);
builder.AddEnvironmentVariables();
Configuration = builder.Build(); Configuration = builder.Build();
@ -33,7 +35,8 @@
c.UseSqlServer(Configuration["ConnectionString"]); c.UseSqlServer(Configuration["ConnectionString"]);
c.ConfigureWarnings(wb => c.ConfigureWarnings(wb =>
{ {
wb.Throw(RelationalEventId.QueryClientEvaluationWarning); //By default, in this application, we don't want to have client evaluations
wb.Log(RelationalEventId.QueryClientEvaluationWarning);
}); });
}); });
@ -45,10 +48,10 @@
options.DescribeAllEnumsAsStrings(); options.DescribeAllEnumsAsStrings();
options.SingleApiVersion(new Swashbuckle.Swagger.Model.Info() options.SingleApiVersion(new Swashbuckle.Swagger.Model.Info()
{ {
Title = "Values API", Title = "Catalog HTTP API",
Version = "v1", Version = "v1",
Description = "An API API With Swagger for RC2", Description = "The Catalog Service HTTP API",
TermsOfService = "None" TermsOfService = "Terms Of Service"
}); });
}); });
@ -59,10 +62,8 @@
}); });
} }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{ {
//Configure logs //Configure logs
if (env.IsDevelopment()) if (env.IsDevelopment())

View File

@ -47,7 +47,7 @@
"wwwroot", "wwwroot",
"Views", "Views",
"Areas/**/Views", "Areas/**/Views",
"settings.Production.json", "settings.json",
"web.config", "web.config",
"project.json", "project.json",
"Dockerfile" "Dockerfile"

View File

@ -1,11 +0,0 @@
{
"ConnectionString": "Server=tcp:127.0.0.1,1455;Initial Catalog=CatalogDB;User Id=sa;Password=Pass@word",
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Debug",
"System": "Information",
"Microsoft": "Information"
}
}
}