Cześć oto mój model domenowy:
using System;
using System.Collections.Generic;
using System.Text;
namespace Work.Core.Domain
{
public class Tenure
{
public Guid Id { get; protected set; }
public string Name { get; protected set; }
public string Description { get; protected set; }
public decimal Rate { get; protected set; }
public string City { get; protected set; }
public Guid CompanyId { get; protected set; }
public virtual Company Company { get; protected set; }
protected Tenure()
{
}
public Tenure(string name, string description, decimal rate, string city, Guid companyId)
{
Name = name;
Description = description;
Rate = rate;
City = city;
CompanyId = companyId;
}
}
public string GetCompanyName() => Company.Name;
}
}
Mam w niej fukcję GetCompany Name dlaczego ona zwraca null ?