So I have this method:
public IList<IndicationProject> GetProjectsForSponsor(int sponsorId)
{
IList<IndicationProject> result = new List<IndicationProject>();
IWspWB_IndicationGetProjectsForEntityResultSet tmpResultSet = ExecWspWB_IndicationGetProjectsForEntity(sponsorId);
if (tmpResultSet.WspWB_IndicationGetProjectsForEntity1 != null)
{
foreach (WspWB_IndicationGetProjectsForEntity1LightDataObject ldo in tmpResultSet.WspWB_IndicationGetProjectsForEntity1)
{
result.Add(
new IndicationProject()
.Named(NullConvert.From(ldo.Stp_name, null))
.IdentifiedBy(NullConvert.From(ldo.Stp_straight_through_processing_id, 0))
);
}
}
return result;
}
Contained within this class:
namespace Web.Data.Indications
{
public partial class IndicationsDataTier
{
I want to use that method in another one of my classes, like so:
IList<IndicationProject> oldList = Web.Data.Indications.IndicationsDataTier.GetProjectsForSponsor(entityId);
But when I compile I get this error:
Error 44 An object reference is required for the non-static field, method, or property 'Web.Data.Indications.IndicationsDataTier.GetProjectsForSponsor(int)'
The method is not static so you need to actually instantiate the IndicationsDataTier