Thank you @ryancyq and @ismcagdas for you support so far. We have decided to not follow up on the PhoneBook examle and are using the ApsNetZero Extension instead which is working fine. Thus we can close this issue.
This is my AddPhoneInput.cs
usingSystem.ComponentModel.DataAnnotations;
namespace rytlex.Persons.Dto
{
public class AddPhoneInput
{
[Range(1, int.MaxValue)]
public int PersonId { get; set; }
[Required]
public PhoneType Type { get; set; }
[Required]
[MaxLength(PhoneConsts.MaxNumberLength)]
public string Number { get; set; }
}
}
Thank you for your quick response! That was indeed the issue! :D
Thanks! Disabling the filter seems to work to some extent. But I still have trouble with objects that contain foreign keys. For example:
This is the Request object:
public class Request : FullAuditedEntity, IMustHaveTenant
{
...
[ForeignKey("RequestorId")]
public virtual User Requestor { get; set; }
public virtual long? RequestorId { get; set; }
...
}
This is the GetRequests service method:
public ListResultOutput<RequestListDto> GetRequests(GetRequestsInput input)
{
using (CurrentUnitOfWork.DisableFilter(AbpDataFilters.MustHaveTenant))
{
var requests = _requestRepository
.GetAll()
.Include(p => p.Requestor)
.WhereIf(
!input.Filter.IsNullOrEmpty(),
p =>
p.Requestor.UserName.Contains(input.Filter) ||
p.Requestor.Name.Contains(input.Filter) ||
p.Requestor.Surname.Contains(input.Filter) ||
p.Requestor.EmailAddress.Contains(input.Filter)
)
.OrderByDescending(p => p.CreationTime)
.ToList();
return new ListResultOutput<RequestListDto>(requests.MapTo<List<RequestListDto>>());
}
}
Without disabling the filter, I didn't see any Request objects. Thanks to your suggestion and using the code above, I'm at least getting all the requests now from host. But the Requestor inside Request is null, probably because disabling the filter in the current unit of work doesn't apply there.
Do you have any suggestions or ideas on how to disable the filter in this case? Maybe somehow recursively or some kind of "always disable filter, if I am host". Thanks!
Hi again,
meanwhile I was able to set it up properly and now sending mails is working fine. I missed to remove check from default credentials and thus wasn't seeing the hidden fields.
For anyone who is interested in how to set it up:
That should be it.
Regards, Tuna
Thanks! We had to update ABP though, because token-based authentication seems to be fairly new. ;) But it works great!
I think we may have found a bug. In AccountController.cs there was no LocalizationSourceName set. That's why we got this error, when it tried to throw a UserFriendlyException for an invalid username/password or other errors:
Abp.AbpException: Must set LocalizationSourceName before, in order to get LocalizationSource