Return list by WCF

0

I want to return a list for a webservice, the list is for employees, and I want to return a series of data.

The problem is that I do not know the logic as the interface and the service in WCF work.

[ServiceContract]
public interface IWSEmpleados
{





}

[DataContract]
public class Empleados
{
    public string Conomina { get; set; }
    public string Tipodocumento { get; set; }
    public string Documento { get; set; }
    public string Nombre { get; set; }
    public string Apellido1 { get; set; }
    public string Apellido2 { get; set; }
    public string Sexo { get; set; }
    public string Fnacimiento { get; set; }
    public string Sueldoneto { get; set; }
    public string Descuento { get; set; }
    public string Sueldosecundario { get; set; }


}

public class CompositeType
{

}
    
asked by Maicol Lenin 27.10.2017 в 22:51
source

1 answer

0

In the interface you have to put

[ServiceContract] public interface IWSEmpleados { [OperationContract] List<Empleados> getListEmpleados(); }

in the serious service

public class EmpleadoWCFservice : IWSEmpleados { public List<Empleado> GetListEmpleado() { List<Empleado> lstEmpleado = new List<Empleado>(); return lstEmpleado; } } You can find more information in this example always stackoverflow link

    
answered by 27.10.2017 в 23:37