when executing the index generates this error

0

when executing the index it generates this error I am working with entity framework 6

my web.config

<basicHttpBinding>
    <binding name="bsBinding" maxBufferPoolSize="214748647" maxBufferSize="214748647" maxReceivedMessageSize="214748647" />
  </basicHttpBinding>

my driver to generate my index is the following:

public class RRHH_MUNICIPIOController : Controller
{
    RRHH_MUNICIPIOClient db = new RRHH_MUNICIPIOClient();
    RRHH_DEPARTAMENTOClient dbDepto = new RRHH_DEPARTAMENTOClient();
    public RRHH_MUNICIPIOController()
    {
        mapa.Mapeo.CrearMapas();
    }
    // GET: RRHH_MUNICIPIO
    public ActionResult Index()
    {          
            IEnumerable<ent.RRHH_MUNICIPIO> listar = db.TraerTodo();
            IEnumerable<mod.RRHH_MUNICIPIOModel> entidad = Mapper.Map<IEnumerable<ent.RRHH_MUNICIPIO>, IEnumerable<mod.RRHH_MUNICIPIOModel>>(listar);
            return View(entidad);        

    }

my proxy is the following:

 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IRRHH_MUNICIPIO/TraerTodo", ReplyAction="http://tempuri.org/IRRHH_MUNICIPIO/TraerTodoResponse")]
System.Collections.Generic.List<AplicacionEntidad.RRHH_MUNICIPIO> TraerTodo();
    
asked by rmonroy 12.09.2017 в 00:02
source

1 answer

1

For the error message you sample problem seems to be that the data you're trying to bring you have more than 65536 bytes meustra you the error message size.

To solve that you can attack them in two ways:

On the one hand, instead of "bring All", you could make a page that does not exceed the established data limit.

Or you could increase the binding data limit that you are using. For this you have to increase set a different value to the current one (65536) in the property MaxReceivedMessageSize for example 1000000.

If you can put your app.config and the code where it gives you the error we could help you better

    
answered by 12.09.2017 / 11:43
source