オブジェクトのセットを検証したいのですが、それらをまとめて作成する必要があります。
var mensajesDeValidacion = _validador.Valida();
if (!_validador.EsValido){
throw new ValidacionException("Corrija los siguientes errores", mensajesDeValidacion);}
public class Empresa : IEmpresa
{
public int IdEmpresa{get;set;}
public string Nombre{get;set;}
}
public interface IEmpresa
{
int IdEmpresa{get;set;}
string Nombre{get;set;}
}
と他のクラス
public class ContactoEmpresa : IContactoEmpresaEmpresa
{
public int IdContactoEmpresaEmpresa{get;set;}
public string Direccion{get;set;}
}
public interface IContactoEmpresaEmpresa
{
int IdContactoEmpresaEmpresa{get;set;}
string Direccion{get;set;}
}
この 2 つ以上のオブジェクトを結合するにはどうすればよいですか?