We have models:
public class EmployeeFunction{ public int Id {get;set;} public string Name {get;set;} } public class Employee public int Id{get;set;} public string Code {get; set;} public string Name {get;set;} public EmployeeFunction EmployeeFunction{get;set;} } For models, we have the implementation of the repositories:
public interface IRepository<T> { //... } public abstract class RepositoryBase<T> : IRepository<T>{ //... } public class EmployeesRepository<Employee> { //... } public class EmployeeFunctionsRepository<EmployeeFunction> { //... } Using MVVM Light Toolkit repositories are injected into ViewModel.
public class EmployeesViewModel{ //... private IRepository<Employee> _repository; public ObservableColeection<Emolyee> Items { get; private set; } public EmployeesViewModel(IRepository<Employee> repository){ _repository = repository; Items = _repository.GetAll(); } //... } How does this approach fill the EmployeeFunction property in the Employee class? I understand that there should be a link to the EmployeeFunction instance, obtained from the corresponding repository. Those. Does the employee repository have to pull the repository of posts to get the necessary link?