C# ERROR CS7036 Entity Framework and stored procedures

Viewed 210

I am trying to do a crud with Entity Framework and stored procedures in SQL Server, I have difficulties with the save method and the modify method.

I get the following error when I try to assign my stored procedure a data model to modify,

CS7036 C# There is no argument given that corresponds to the required formal parameter of

This is my model in Entity Framework:

enter image description here

This is my data model

namespace TiendaStoredProceduresEF.Models
{
    using System;
    using System.Collections.Generic;

    public partial class RegistroAlmacen
    {
        public decimal IdRegistro { get; set; }
        public decimal IdSucursal { get; set; }
        public decimal IdProducto { get; set; }
        public decimal Cantidad { get; set; }

        public virtual Producto Producto { get; set; }
        public virtual Sucursal Sucursal { get; set; }
    }
}

Here is the access to the stored procedures in SQL Server:

namespace TiendaStoredProceduresEF.Datos
{
    public class RegistroAlmacenAdmin
    {       
        public void GuardarRegistro(RegistroAlmacen modelo)
        {    
            using (TiendaRealEntities contexto = new TiendaRealEntities())
            {
                contexto.GuardarRegistroAlmacen(modelo); 
                contexto.SaveChanges();
            }
        }       
    }
}

The error appears on the line

contexto.GuardarRegistroAlmacen(modelo);

There is no argument given that corresponds to the required formal parameter IProducto of TiendaRealEntities.GuardarRegistroAlmacen

According to the law on error CS7036, I have to create an empty constructor, but I don't know how or where

0 Answers
Related