When adding the user as a navigation property via the abp suite, there is always a build error pre add-migration.
* Severity Code Description Project File Line Suppression State Suppression State Error CS0246 The type or namespace name 'AppUserDto' could not be found (are you missing a using directive or an assembly reference?) VideoMarking.Application.Contracts \aspnet-core\src\VideoMarking.Application.Contracts\Notes\NoteWithNavigationPropertiesDto.cs 12 Active
If we manually add the AppUserDto, the build error goes but when we manually run add-migration it errors with:
The property 'AppUser.ExtraProperties' could not be mapped, because it is of type 'Dictionary<string, object>' which is not a supported primitive type or a valid entity type. Either explicitly map this property, or ignore it using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'.
The AppUserDto looks like this:
public class AppUserDto : FullAuditedEntityDto<Guid>
{
public Guid? TenantId { get; private set; }
public string UserName { get; private set; }
public string Name { get; private set; }
public string Surname { get; private set; }
public string Email { get; private set; }
public bool EmailConfirmed { get; private set; }
public string PhoneNumber { get; private set; }
public bool PhoneNumberConfirmed { get; private set; }
public bool SEN { get; set; }
public bool PupilPremium { get; set; }
public bool EAL { get; set; }
public bool ChildInCare { get; set; }
public DateTime DateOfBirth { get; set; }
}
We have tried adding b.ConfigureExtraProperties();
to the model builder in the dbcontext to no effect as suggested here: https://github.com/abpframework/abp/issues/1517
We have not been able to find a solution to this issue and we require the ability to link numerous entities to the user table.
Please can someone advise the proper way to achieve this.
Thanks