MVC Dependency Injection into classes
Hi,I have a service (service1) that is added to dependency injection as a singleton class at the start up (startup.cs). I am also implementing IViewLocationExpander (BrandLocationExpandor) in order to...
View ArticleReturning a Razor View runs in a new Thread
Hey,I'm writing an MVC Core app which I've hand cranked my own localisation system (I'm doing things beyond the scope of the standard core one) which uses request filters etc to set various bits of...
View ArticleThis is test issue non-ASCII characters... Turkish character ş ü ö İ ğ ı
Hi,I cant use non-ASCII characters in url or headers. so I want to try it on this forum. I need help about that I want to use non-ascii character in url....
View ArticleI can not use localization character in url example ş ü ö İ ğ ı
Hi,I can not use localization character in url example ş ü ö İ ğ ı I created a new project that microsoft template for asp.net core (default project with model-view-controller).after that I added one...
View ArticleSoft-delete, Cannot update identity column?
I Have the following entity, I am trying to apply the concept of soft delete by adding a shadow property ("IsDeleted") when I run my controller I get the following error,fail:...
View Articleajax with return Json(new { success = false}) return black page with...
Hi I trying to return alert using json success but when file is not image and click save, it go into if (!allowedExtensions.Contains(checkextension)) but it return blank page with...
View Article.NET Core MVC Resource files are compiled
Hi I have created resx files in order to dynamically change certain contents on views. I find that the resource files are compiled. I was under the impression that resource files can be updated after...
View Articleajax with json success
I trying to return alert when it is not image type. but it return blank page with {"success":false,"responseText":"file is not image type"} url: Home/SaveUpdateData. I tired change JsonResult but...
View ArticleUnit Testing Authorize attribute policy
Hi, I would like to test my controller[Authorize(Policy = "CatalogManager")] [HttpPut("update")] public async Task<IActionResult> Update([FromBody] ProductForEditViewModel...
View ArticleUnit test verify excution path if (product.Owner != email)
Hi, I have the following code public async Task UpdateAsync(int productId, string email) { var product = await GetAsync(productId); if (product.Owner != email) { throw new AuthenticationException($"You...
View ArticleNet Core dropdowns selection dyanmic to other dropdowns
<div class="votecell post-layout--left"></div> <div class="postcell post-layout--right"> <div class="post-text" itemprop="text">Hi All,I have a dropdown selection within my site...
View ArticleEntity Framework Core [NotMapped] property helper to retrieve single entity...
I want to be able to achieve something like:public class EntityWithCollection { public int Id { get; set; } [NotMapped] public DependentEntity { get { return Dependencies?.SingleOrDefault(d =>...
View ArticleWhat's the equivalent of Session_Start in Global.asax file ASP MVC in CORE MVC
I am new to Core MVC.What's the equivalent of Session_Start in Global.asax file ASP.Net MVC in CORE MVC?I am looking for sample code.Thanks
View ArticleHow to log exception error to a sql server table in ASP.NET Core MVC
Is there any built in function in .net core that is able to log exception error in a tableThanks
View ArticleClaims Transformation and Authorization Policy in ASP.NET Core
please have a look at this url first https://weblogs.asp.net/imranbaloch/claims-transformation-and-authorization-policy-in-aspnet5-mvc6public virtual Task<ClaimsPrincipal>...
View ArticleWhy IPasswordValidator override the built in asp.net core password validation?
i have the following code in the startup class in asp.net core 2.0 apppublic void ConfigureServices(IServiceCollection services) { services.AddDbContext<AppIdentityDbContext>(options =>...
View ArticleSample Code for ASP.Net Core to Access Active Directory
I have two questions;1.I am looking for how to use .net core to access AD, any sample code? I had used DirectoryServices in standard dotnet, but .net core does not support DirectoryServices.2. Is it...
View ArticlePlugin System
I tried "to suggest something" in github, but N. Taylor Mullen does not seem capable to give any answer…So I try here.ContextI have built a plugin system, based on Application Parts, for my Asp.Net...
View Articleissue on .net core globalization
Hi ~ , I had some issue on .net core globalization.I had been read the article by the following link.https://docs.microsoft.com/en-us/aspnet/core/fundamentals/localization?view=aspnetcore-2.1but I...
View Articleissue on output Chinese characters in razor page
Hi~In razor page:var t1 = "@("测试")"; var t2 = "@(Html.Raw("测试"))";In the above ,why the Chinese characters will auto convert to Unicode characters when render ?Here's the resultvar t1 =...
View Article