Skip to content

Commit

Permalink
#1364 Update to use latest CSLA namespaces/types
Browse files Browse the repository at this point in the history
  • Loading branch information
rockfordlhotka committed Oct 10, 2019
1 parent e0bee0e commit fbe0573
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Csla" Version="5.1.0-R19100702" />
<PackageReference Include="Csla" Version="5.1.0-R19100907" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Samples/RazorPagesExample/DataAccess/DataAccess.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Csla" Version="5.1.0-R19100702" />
<PackageReference Include="Csla" Version="5.1.0-R19100907" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
<label asp-for="Item.Name" class="control-label"></label>
<input asp-for="Item.Id" hidden />
<input asp-for="Item.Name" class="form-control" />
<span csla-errors-for="Item.Name" class="text-danger"></span>
<span csla-warnings-for="Item.Name" class="text-warning"></span>
<span csla-information-for="Item.Name" class="text-info"></span>
@*<span asp-validation-for="Item.Name" class="text-danger"></span>*@
<span class="text-danger">@Model.GetPropertyInfo("Name").ErrorText</span>
<span class="text-warning">@Model.GetPropertyInfo("Name").WarningText</span>
<span class="text-info">@Model.GetPropertyInfo("Name").InformationText</span>
</div>
<div class="form-group">
<input type="submit" value="Save" class="btn btn-primary" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@using RazorPagesExample
@namespace RazorPagesExample.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, Csla.AspNetCore
@addTagHelper *, RazorPagesExample
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Csla.AspNetCore" Version="5.1.0-R19100702" />
<Compile Remove="TagHelpers\**" />
<Content Remove="TagHelpers\**" />
<EmbeddedResource Remove="TagHelpers\**" />
<None Remove="TagHelpers\**" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Csla.AspNetCore" Version="5.1.0-R19100907" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="3.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.0.0" />
</ItemGroup>
Expand Down
7 changes: 6 additions & 1 deletion Samples/RazorPagesExample/RazorPagesExample/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ public void ConfigureServices(IServiceCollection services)
{
services.AddRazorPages();

services.AddHttpContextAccessor();
services.AddCsla();
services.AddTransient(typeof(DataAccess.IPersonDal), typeof(DataAccess.PersonDal));
}

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IServiceProvider serviceProvider)
{
if (env.IsDevelopment())
{
Expand All @@ -56,6 +57,10 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
endpoints.MapRazorPages();
});

var c = Csla.ApplicationContext.WebContextManager;

var httpContextAccessor = (Microsoft.AspNetCore.Http.IHttpContextAccessor)serviceProvider.GetService(typeof(Microsoft.AspNetCore.Http.IHttpContextAccessor));

app.UseCsla();
}
}
Expand Down

0 comments on commit fbe0573

Please sign in to comment.