I’m having an issue with the [AutoDefault(Value = “userAuthId”)] when creating/updating with AutoQuery
` [ValidateIsAuthenticated]
[AutoApply(Behavior.AuditCreate)]
[Route("/appointments", "POST")]
public partial class CreateAppointments
: IReturn<IdResponse>, IPost, ICreateDb<Appointments>
{
public Guid Id { get; set; }
public DateTime? ApptDateTime { get; set; }
public string? Place { get; set; }
public string? PlaceNotes { get; set; }
public string? ProviderName { get; set; }
[AutoDefault(Value = "userAuthId")]
public int AppUserId { get; set; }
}. `
This is an example DTO and I get the following error:
ServiceStack.OrmLite.IOrmLiteDialectProvider[0]
Error in Int32Converter.ToDbValue() for field ‘AppUserId’ of Type ‘System.Int32’ with value ‘String’
System.FormatException: The input string ‘userAuthId’ was not in a correct format.
I actually had this all working in all my DTO’s autopopulating the AppUserId, and for whatever reason it now throws this error. I tried userAuthId.toInt() from another post on here but still throws the error.
This is the start of my AppUser class:
public partial class AppUser : IUserAuth { [AutoIncrement] public int Id { get; set; }
All auth tables User Id’s are integers, and every reference to the AppUser.Id is integer as well except the session.UserAuthId.
Do you have any ideas what I can be doing wrong? If needed I can make the repo public.