MVC アプリケーションによって生成されたクラスの部分クラスを作成しようとしている MVC アプリケーションを開発しています。たとえば、Location クラスです。
ここで、新しいクラス ファイルに Location クラスの部分クラスを作成します。
以下のクラス コードは、ロケーション コードの MVC によって自動生成されます。
namespace CRM
{
public partial class Location
{
public int Id { get; set; }
public string Name { get; set; }
public string Remark { get; set; }
}
}
上記のファイルの部分クラスを含む新しいクラス ファイルを追加しました
namespace CRMEntities.Partial_Class
{
public interface ILocation
{
[StringLength(50, ErrorMessage = "Region can accept maximum 50 characters.")]
string Region { get; set; }
[Key]
int Id { get; set; }
[Required]
string Name { get; set; }
string Remark { get; set; }
}
public partial class Location : ILocation
{
}
}
以下のエラーが表示されます...
CRMEntities.Partial_Class.Location' does not implement interface member 'CRMEntities.Partial_Class.ILocation.Name