public partial class IICustomer : IEntity
{
public int CreatedByEmployeeId { get; set; }
public virtual IItem IItem { get; set; }
}
public partial class IItem : IEntity
{
public string ItemName { get; set; }
}
I want to access ItemName
through the object of IICustomer
.
public void SaveIICustomers(int itemId, [FromBody] IEnumerable<CustomerDto> customers)
{
IICustomer items = new IICustomer();
items.IItem.ItemName="Sam"; // exception is thrown here
}
But the above code is throwing a NullReferenceException
Object reference not set to instance of object.