Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "aaron"

Answer

It should be IRepository<ExtendedAuditLog, long> since AuditInfo is not an entity.

If you don't want to use CustomData (as suggested by @alirizaadiyahsi), you have to do your custom insert (as suggested by @alper). You should override Task SaveAsync(AuditInfo auditInfo) to save your ExtendedAuditLog, but NOT call base.SaveAsync(auditInfo).

Resolved here: #4101@346344f6-15e8-4523-9b12-bb98907bebc3

Running

dotnet build

from the command line in the public project folder will fix this.

You can implement IExceptionFilter and replace the exception:

public class ExceptionFilter : IExceptionFilter, ITransientDependency
{
    public void OnException(ExceptionContext context)
    {
        if (context.Exception is UserFriendlyException)
        {
            return;
        }

        context.Exception = new UserFriendlyException("We could not service your request at this stage, please try again later", context.Exception);
    }
}

Then, in Startup class, add the filter in ConfigureServices method:

services.AddMvc(options =>
{
    options.Filters.AddService(typeof(ExceptionFilter));
});
Answer

Can you describe your use case?

  1. Did you put a breakpoint to see if that code is executed at all?
  2. Don't create UserManager wrapper like that, and don't new it:
UserManager userManager = new UserManager();
...
protected class UserManager : AgbizCareersDemoAppServiceBase { }
  • Perhaps you were figuring out how to use a ContractResolver: <a class="postlink" href="https://github.com/aspnet/Mvc/issues/4842">https://github.com/aspnet/Mvc/issues/4842</a>
  • You can use IocManager.Instance and ResolveAsDisposable to resolve a proper reference to UserManager.

Do you mean:

Nice share, @BBakerMMC. "Google says" is a bit misleading though, more like "Google gives this link".

I would like to share a set of examples:

  • int: "Categories" of Items (many Items to one Category)
  • long: "Items" that any user can create
  • Guid: "Notifications" that are system-generated when an event occurs on an Item (many Notifications to one Item)

Deal breakers from the article:

  • You DON'T want your URLs to be "hackable" by your end-users (or can't do proper permission checking on ids) → Guid
  • You need to be able to combine data from difference sources with little-to-no chance of duplicate GUIDs → Guid
  • sequential integers may give away other information (from a comment on the article) → Guid

It looks like you are using a pre-v2.1.0 version of ABP. Try upgrading to v2.3.0.

Please read:

If you install a fresh version of VS 2017, then NuGet and .NET Core SDK version should be correct. Otherwise, install those manually.

Showing 1071 to 1080 of 1543 entries