I have this code:
public ObjectModel.Path GetPath(int pathid)
{
var path = this.DbContext.Paths.Find(pathid);
var app = GetApplicationById(path.ApplicationId.GetValueOrDefault());
var p = new Path
{
ApplicationId = path.ApplicationId,
Id = path.Id, Password = path.Password,
UserName = path.UserName,
LocalUrl = string.IsNullOrEmpty(path.LocalUrl) ? null : System.IO.Path.Combine(path.LocalUrl, app.Name)
};
return p;
}
Variable palways null. How is this possible?
Here is the print screen I'm talking about:

I also try with immediate windows, I got this:

pCANNOT BE NULL, since im creates a new instance, while all its properties are non-zero. I tried to clear the project, restart the windows, open the visual studio as an administrator, and nothing happened.
Any idea why?
The application runs on .net 4.0, visual studio 2017 v15.2 (26430.13) relase.
source
share