我是ABP框架的新手,最近开始尝试这一工作。我是3类,即Employee
类,存储在雇员表中,EmployeesAddress
类,存储有关雇员的多个地址的信息,然后Address
类,存储实际的地址。我已将所有这些声明为多租户实体。
我已经创建了DTO
,即EmployeeDTO
和CreateUpdateEmployeeDTO
,用于创建和更新Employees
。我正在尝试为Employee
实现CRUD服务并继承AsyncCrudAppService
。将存储库注入基类时,会收到错误EmployeeAppServices
未实现接口GetListAsync(CreateUpdateEmployeeDTO)
。我在这里想念东西吗?
'EmployeeAppService'未实现接口成员'IAsyncCrudAppService.GetListAsync(CreateUpdateEmployeeDTO)'
public class Employee : FullAuditedAggregateRoot<Guid>, IMultiTenant
{
public Guid? TenantId { get; set; }
public Guid? DepartmentId { get; set; }
public Guid? ManagerId { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string FamilyName { get; set; }
public string DisplayName { get; set; }
public Nationality Nationality { get; set; }
public Sex Gender { get; set; }
public MaritalStatus MaritalStatus { get; set; }
public string DateOfBirth { get; set; }
public string DateOfJoining { get; set; }
public virtual ICollection<EmployeeAddress> EmployeeAddress { get; private set; }
protected Employee()
{
EmployeeAddress = new HashSet<EmployeeAddress>();
}
}
public class EmployeeAddress : FullAuditedEntity<Guid>, IMultiTenant
{
public Guid? TenantId { get; set; }
public Guid EmployeeId { get; set; }
public Guid AddressId { get; set; }
public virtual Address Address { get; set; }
public virtual Employee Employee { get; set; }
protected EmployeeAddress()
{
}
}
public class Address : FullAuditedEntity<Guid>, IMultiTenant
{
public Guid? TenantId { get; set; }
public AddressType AddressType { get; set; }
public string AddressLine1 { get; set; }
public string AddressLine2 { get; set; }
public string City { get; set; }
public string State { get; set; }
public string County { get; set; }
public string ZipCode { get; set; }
public virtual EmployeeAddress EmployeeAddress { get; set; }
protected Address()
{
}
}
public class EmployeeDTO : FullAuditedEntityDto<Guid>
{
public string FirstName { get; set; }
public string LastName { get; set; }
public string FamilyName { get; set; }
public string DisplayName { get; set; }
public Nationality Nationality { get; set; }
public Sex Gender { get; set; }
public MaritalStatus MaritalStatus { get; set; }
public string DateOfBirth { get; set; }
public string DateOfJoining { get; set; }
//public List<EmployeAddress> EmployeeAddress { get; private set; }
}
public class CreateUpdateEmployeeDTO
{
[Required]
[StringLength(50)]
public string FirstName { get; set; }
[StringLength(50)]
public string LastName { get; set; }
public string FamilyName { get; set; }
public string DisplayName { get; set; }
[Required]
public Nationality Nationality { get; set; }
[Required]
public Sex Gender { get; set; }
[Required]
public MaritalStatus MaritalStatus { get; set; }
public string DateOfBirth { get; set; }
public string DateOfJoining { get; set; }
}
public class EmployeeAppService :
AsyncCrudAppService<Employee, EmployeeDTO, Guid, PagedAndSortedResultRequestDto,
CreateUpdateEmployeeDTO, CreateUpdateEmployeeDTO>, IEmployeeAppService
{
public EmployeeAppService(IRepository<Employee,Guid> repository) : base(repository)
{
}
}