我有一个简单的业务经理外观,应该只保留一些库存信息。但是,我不断收到错误消息,即“Home.Services.InventorySvc”是一种用作变量的类型。
我的门面代码。
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);
}
}
}
InventorySvc 代码
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);
}
}