I have a simple business manager facade that should just persist some inventory information. However I keep getting the error that "Home.Services.InventorySvc" is a type being used as a variable.
My facade code.
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Home.Domain; using Home.Services; namespace Home.Business { public class InventoryMngr { public void Create(CreateInventory inv) { Factory factory = Factory.GetInstance(); InventorySvc invSvc = (InventorySvc)factory.GetService( (InventorySvc).Name); invSvc.CreateInventory(inv); } } } The InventorySvc code
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Home; using Home.Domain; namespace Home.Services { public interface InventorySvc : IService { void CreateInventory(CreateInventory createinventory); } }
(InventorySvc).Name(since this was originally tagged as homework). Presumably, this should be a string from somewhere. You are using the type name, rather than an instance, so there is no object from which to retrieve the Name property.