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(); .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();


+ 9
- 8
src/Services/Catalog/Catalog.API/Startup.cs 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)
.AddEnvironmentVariables();
.AddJsonFile($"settings.json", optional: false, reloadOnChange: true)
.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",
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) public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{ {
//Configure logs //Configure logs
if (env.IsDevelopment()) if (env.IsDevelopment())


+ 1
- 1
src/Services/Catalog/Catalog.API/project.json 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"


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