I have looked at the forum but did not understand. Can you help? I get this error: 'Object reference not set to an instance of an object.'.
public class ManagerPanelInformationManager : IManagerPanelInformationService
{
internal IManagerPanelInformationDal _managerPanelInformationDal;
public ManagerPanelInformationManager()
{
}
internal ManagerPanelInformationManager(IManagerPanelInformationDal iManagerPanelInformationDal)
{
_managerPanelInformationDal = iManagerPanelInformationDal;
}
public void Add(ManagerPanelInformation managerPanelInformation)
{
_managerPanelInformationDal.Add(managerPanelInformation);
}
public void Update(ManagerPanelInformation managerPanelInformation)
{
_managerPanelInformationDal.Update(managerPanelInformation);
}
public void Delete(ManagerPanelInformation managerPanelInformation)
{
_managerPanelInformationDal.Delete(managerPanelInformation);
}
public List<ManagerPanelInformation> Get()
{
return _managerPanelInformationDal.Get();
}
public List<ManagerPanelInformation> GetAll()
{
return _managerPanelInformationDal.GetAll();
}
public List<ManagerPanelInformation> GetManagerPanelInformationByManagerPanelInformationsId(int managerPanelInformation)
{
throw new NotImplementedException();
}
}
public interface IManagerPanelInformationService
{
List<ManagerPanelInformation> GetAll();
List<ManagerPanelInformation> Get();
List<ManagerPanelInformation> GetManagerPanelInformationByManagerPanelInformationsId(int managerPanelInformation);
void Add(ManagerPanelInformation managerPanelInformation);
void Update(ManagerPanelInformation managerPanelInformation);
void Delete(ManagerPanelInformation managerPanelInformation);
}
internal interface IManagerPanelInformationDal : IEntityRepository<ManagerPanelInformation>
{
}
public class EfManagerPanelInformationDal : EfEntityRepositoryBase<ManagerPanelInformation, ManagerPanelContext>, IManagerPanelInformationDal
{
}
public interface IEntityRepository<T> where T : class, IEntity, new()
{
List<T> GetAll(Expression<Func<T, bool>> filter = null);
void Add(T entity);
void Update(T entity);
void Delete(T entity);
List<T> GetId(Expression<Func<T, bool>> filter = null);
List<T> Get(Expression<Func<T, bool>> filter = null);
}
I am getting the error here;
public List<ManagerPanelInformation> GetAll()
{
return _managerPanelInformationDal.GetAll();
}
public void idGetir()
{
dgwRules.DataSource = _iManagerPanelInformationService.GetAll();
}
public void Ayarlar_Load(object sender, EventArgs e)
{
idGetir();
}
Other things ;
public class ManagerPanelInformation : IEntity
{
public int Id { get; set; }
public int TC { get; set; }
public string Kurallar { get; set; }
}
public class ManagerPanelContext : DbContext
{
internal DbSet<ManagerPanelInformation> ManagerPanelInformations { get; set; }
}