Browse Source

Remove unnecesary comments and review settings

pull/49/merge
Unai 8 years ago
parent
commit
3e001b40f0
5 changed files with 11 additions and 20 deletions
  1. +1
    -0
      src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs
  2. +9
    -8
      src/Services/Catalog/Catalog.API/Startup.cs
  3. +1
    -1
      src/Services/Catalog/Catalog.API/project.json
  4. +0
    -0
      src/Services/Catalog/Catalog.API/settings.json
  5. +0
    -11
      src/Services/Catalog/Catalog.API/settings.production.json

+ 1
- 0
src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs View File

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


+ 9
- 8
src/Services/Catalog/Catalog.API/Startup.cs View File

@ -17,8 +17,10 @@
{
var builder = new ConfigurationBuilder()
.SetBasePath(env.ContentRootPath)
.AddJsonFile($"settings.{env.EnvironmentName}.json", optional: false)
.AddEnvironmentVariables();
.AddJsonFile($"settings.json", optional: false, reloadOnChange: true)
.AddJsonFile($"settings.{env.EnvironmentName}.json", optional: true);
builder.AddEnvironmentVariables();
Configuration = builder.Build();
@ -33,7 +35,8 @@
c.UseSqlServer(Configuration["ConnectionString"]);
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.SingleApiVersion(new Swashbuckle.Swagger.Model.Info()
{
Title = "Values API",
Title = "Catalog HTTP API",
Version = "v1",
Description = "An API API With Swagger for RC2",
TermsOfService = "None"
Description = "The Catalog Service HTTP API",
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)
{
//Configure logs
if (env.IsDevelopment())


+ 1
- 1
src/Services/Catalog/Catalog.API/project.json View File

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


src/Services/Catalog/Catalog.API/settings.development.json → src/Services/Catalog/Catalog.API/settings.json View File


+ 0
- 11
src/Services/Catalog/Catalog.API/settings.production.json 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"
}
}
}

Loading…
Cancel
Save