Cannot implicitly convert type 'short?' to 'short' at LocalAmount = t.EmpNo. I used Convert.ToInt16(t.EmpNo)
but then the 'join'
clause will get an error and be "incorrect", "type inference failed..."
public class AccountTransaction
{
public Int16 LocalAmount { get; set; }
public String AccountNumber { get; set; }
}
public static IEnumerable<AccountTransaction> GetAllTransactions()
{
using (var context = new SQL_TA_SCOREBOARDEntities1())
{
return (from t in context.EmployeeAccesses
join acc in context.View_HCM
on t.EmpNo equals acc.EmpNo
select new AccountTransaction
{
LocalAmount = t.EmpNo,
AccountNumber = acc.EmailAddress
}).ToList();
}
}