I have upgraded my code from net core 2.2 to .net6.0, after upgrading the respective packages, I can be able to execute part of code, but when I try to execute the stored procedure in one of method, it gets failed with null exception. other methods are running fine for other SP executions. I have verified in DB by executing SP manually, it works fine. it is getting null exception error. Mostly the result from SP is not able to load into the model. Need help on this.
your text
private async Task<IEnumerable> MentorRepDetails(string userId)
{your text
var uId = new SqlParameter("@userId", userId);
using (var ctx = _generateDbContext.GenerateNetCoreContext(_configuration))
{
DbSet s = ctx.Set();your text
var data = await s.FromSqlRaw($"EXEC Supp @userId", uId).AsQueryable().ToListAsync();
return data;
}
}
公职人员
{
[JsonProperty("UserId")]
public string UserId { get; set; }
[JsonIgnore]
[JsonProperty("MenteeUserId")]
public string MenteeUserId { get; set; }
[JsonProperty("FirstName")]
public string FirstName { get; set; }
[JsonProperty("LastName")]
public string LastName { get; set; }
[JsonProperty("code")]
public string Code { get; set; }
[JsonProperty("Status")]
public string Status { get; set; }
[JsonProperty("ACode")]
public string ACode { get; set; }
[JsonProperty("PRole")]
public string PRole { get; set; }
[JsonIgnore]
public RepInfo RepInfoData { get; set; }
[JsonProperty("AffRepTeamDetails")]`your text`
public ICollection<TeamInfo> AffRepTeamDetails { get; set; }
public MentorRep()
{
AffRepTeamDetails = new HashSet<TeamInfo>();
}
}
模型Builder.Entity(v =>);
{
v.HasKey(p => new { p.UserId, p.MenteeUserId });
v.HasOne(e => e.RepInfoData)
.WithMany(e => e.AffiliatedRepDetails);
});
我希望,所储存的程序结果无法装入模型,在较早的2. 核心净额中,该模型的运行是罚款的。