.Net Core, Angular v5.1.0 I love the idea of the new Entity change history functionality offered in 5.1.0 and wanted to test before upgrading my current project. I download and create a new project. I add a new entity using the new RAD tool - GREAT JOB GUYS - and disable the Add migration and Update database options so I can carry out some final modifications before migrating to the database::
[Table("NcPerson")]
[Audited]
public class Person : FullAuditedEntity<Guid>, IMustHaveTenant, IMayHaveOrganizationUnit, IExtendableObject
{
public int TenantId { get; set; }
public long? OrganizationUnitId { get; set; }
[Required]
[StringLength(PersonConsts.MaxSalutationLength, MinimumLength = PersonConsts.MinSalutationLength)]
public virtual string Salutation { get; set; }
public string ExtensionData { get; set; }
}
I then migrate to the database. I modify my CoreModule.PreInitialize() method with the following lines:
Configuration.EntityHistory.IsEnabled = true;
Configuration.EntityHistory.Selectors.Add(
new NamedTypeSelector(
"Abp.FullAuditedEntities",
type => typeof(IFullAudited).IsAssignableFrom(type)
));
I compile and run the project successfully. I add several people and update and delete one person. I have no data in my AbpEntityChangeSets table or associated tables. I started without the [Audited] attribute on my entity and without the line Configuration.EntityHistory.IsEnabled = true; (both of which should be unnecessary according to the documentation at [https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/doc/WebSite/Entity-History.md]). What am I doing wrong?
8 Answer(s)
-
0
It's disabled in AbpZeroTemplateEntityFrameworkCoreModule.cs.
-
0
I installed RAD tool but cannot find any info on how to use it? Can you please direct me? Thanks.
-
0
@vladsd You can read the development guide here: https://aspnetzero.com/Documents/Development-Guide-Rad-Tool
-
0
Thanks, got it, consider adding a link to documents page.
-
0
I get an error.. <a class="postlink" href="https://gyazo.com/5ece69f3b2a1df9c719b05ee0758a40e">https://gyazo.com/5ece69f3b2a1df9c719b05ee0758a40e</a> I do have 5.0.6 project, so I need to copy some config files?
-
0
@Aaron, another one of life's little mysteries solved, once again I am in debt to your expertise. An excellent piece of code, well done!!!! This alone is worth the upgrade to 5.1.0, I will wait with baited breath for the user interface... Thank you again for your help.
-
0
Once I copy AspNetZeroRadTool folder into project the tool is working
-
0
@BobIngham :)