Let's simplify my application:
I have two prism modules : shell module which is visualizing some data and a second module - WCF service, which is fetching that data (let's say that data is a name and value of some register). My plan is to set is up as shared service, and inject it as a dependency to one of my shell module classes. My problem is, I have no idea, in which class this service reference should be: in model or in viewmodel (of mainwindow for example).
I could set up a model of a register and it will and be fetching its name and value by itself (using stored reference to WCF service).
But I am not sure that this is a correct way to implement this. My code:
//Bootstrapper.cs ->register WCF service in a container
RegisterTypeIfMissing(typeof(IDatabaseService ), typeof(DatabaseService), true);
This could be my model, that I am referencing in my ViewModel:
public class Register
{
IDatabaseService service; //reference to WCF service (which is in separate module)
public int RegisterValue { get; set; }
public string RegisterName { get; set; }
public Register(IDatabaseService _service) //this will be resolved in a container
{
service = _service;
}
}