It is possible to to specify with Request should be used for on blazor auto Edit Forms?
Let says i have the following example
class MyEntity {
....
[References(typeof(Person))]
public int PersonId {get;set;}
}
class QueryPerson: QueryDb<Person> {}
class QueryPerson2: QueryDb<Person, CustomResponse> {}
When i try to select a person from the auto edit form generated by blazor AutoQueryGrid, it try use QueryPerson2 causing and exception because it can’t cast CustomResponse to Person.
It is possible to specify somewhere to use only QueryPerson?
public class ListingSuggestion : AuditBase
{
[AutoIncrement]
[PrimaryKey]
public long Id { get; set; }
[ValidateMaximumLength(255)]
public string Description { get; set; }
[Required]
[References(typeof(AppUser))]
[Ref(Model = nameof(AppUser), RefId = nameof(AppUser.Id), RefLabel = nameof(AppUser.UserName))]
public int SuggesterId { get; set; }
public long ListingId { get; set; }
[Reference]
public Listing Listing { get; set; }
}
Then i have two autoquery implementations
[ValidateIsAdmin]
[ValidateIsAuthenticated]
public class QueryAppUsers : QueryDb<AppUser>
{
}
[ValidateIsAuthenticated]
[ValidateIsAdmin]
public class QueryAllChefs : QueryDb<AppUser, ChefBasicInfo>
{
public int? Id { get; set; }
}
I think is trying to use QueryAllChefs on the auto generated UI as i get this error, when trying to pick a value for SuggesterId
Ok it’s the ModalLookup having to use an AutoQuery API for its lookup and choosing the API with a different Model Type, which could be fixed in this commit:
if i try to refresh a page url after restarting the dotnet process i get the following error
NullReferenceException: Object reference not set to an instance of an object.
ServiceStack.AppMetadataUtils.GetCache(AppMetadata app) in MetadataTypes.cs
ServiceStack.AppMetadataUtils.GetType(AppMetadata app, string name) in MetadataTypes.cs
ServiceStack.Blazor.Components.Tailwind.LookupInput.get_Icon() in LookupInput.razor.cs
ServiceStack.Blazor.Components.Tailwind.LookupInput.BuildRenderTree(RenderTreeBuilder __builder) in LookupInput.razor
public class QueryCoupons2Response
{
public string Id { get; set; }
public string Description { get; set; }
public int Discount { get; set; }
public DateTime ExpiryDate { get; set; }
}
[Tag("bookings"), Description("Find Coupons")]
[Route("/coupons", "GET")]
public class QueryCoupons2 : QueryDb<Coupon,QueryCoupons2Response>
{
public string Id { get; set; }
}