我不断收到此错误,我不确定我做错了什么。错误1 'Home.Services.InventoryImpl' 不实现接口成员 'Home.Services.InventorySvc.CreateInventory(Home.Services.InventoryImpl)'不实现接口成员 - C#
我的接口代码
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Home;
using Home.Domain;
namespace Home.Services
{
public interface InventorySvc
{
void CreateInventory(InventoryImpl CreateTheInventory);
}
}
我的实现代码
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Home.Domain;
using System.IO;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
namespace Home.Services
{
public class InventoryImpl: InventorySvc
{
public void CreateTheInventory(CreateInventory createinventory)
{
FileStream fileStream = new FileStream
("CreateInventory.bin", FileMode.Create,
FileAccess.Write);
IFormatter formatter = new BinaryFormatter();
formatter.Serialize(fileStream, createinventory);
fileStream.Close();
}
}
}
同意在这里添加我的两分钱后,键入您的:InventorySvc,右键单击界面并选择“实现接口”,这将创建您的方法(和属性)作为底座,然后你只需填写实际的代码。 – iMortalitySX