Fix confronto numero versione: non come stringa ma come obj version
This commit is contained in:
@@ -1261,12 +1261,17 @@ namespace LiMan.DB.Controllers
|
||||
List<ReleaseModel> dbResult = new List<ReleaseModel>();
|
||||
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
|
||||
{
|
||||
Version mVers = new Version(MinVers);
|
||||
// calcolo DTO applicativi
|
||||
dbResult = localDbCtx
|
||||
.DbSetReleases
|
||||
.Where(x => (x.CodApp.ToLower() == CodApp.ToLower()) && x.VersNum.CompareTo(MinVers) > 0)
|
||||
.OrderBy(o => o.ReleaseDate)
|
||||
.ToList();
|
||||
|
||||
// verifico per il criterio versione...
|
||||
dbResult = dbResult
|
||||
.Where(x => x.VersVal >= mVers)
|
||||
.OrderBy(o => o.ReleaseDate)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,20 @@ namespace LiMan.DB.DBModels
|
||||
/// </summary>
|
||||
public string VersText { get; set; } = "0.1a2";
|
||||
|
||||
/// <summary>
|
||||
/// Versione (calcolata) a partire dal valore Num
|
||||
/// </summary>
|
||||
[NotMapped]
|
||||
public Version VersVal
|
||||
{
|
||||
get => new Version(VersNum);
|
||||
//{
|
||||
// Version answ = new Version();
|
||||
// Version.TryParse(VersNum, out answ);
|
||||
// return answ;
|
||||
//}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Data di release
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user