Hi,
RAF is number that is calculed in Developer.cs
you will find below Developer.cs in share project.
namespace WebApp3.Shared.Models
{
public partial class Developer
{
public int Id { get; set; }
….
public DateTime DateSoldePr { get; set; }
public DateTime? DateSuivi { get; set; }
public int RAF {
get
{
if(DateSoldePr.Year < 2000)
{
return 0;
}
if(DateSoldePr.Year > 2000 )
{
return (int) Math.Floor((DateTime.Today - DateSoldePr).TotalDays);
}
else
{
return 0;
}
}
}
…
}
}
After the migrations in ApplicationsDBContextModelSnapshots.cs I didn't see RAF variable
namespace WebApp3.Server.Migrations
{
[DbContext(typeof(ApplicationDBContext))]
partial class ApplicationDBContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.UseIdentityColumns()
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("ProductVersion", "5.0.6");
modelBuilder.Entity("WebApp3.Shared.Models.Developer", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.UseIdentityColumn();
…
b.Property<DateTime>("DateSoldePr")
.HasColumnType("datetime2");
b.Property<DateTime?>("DateSuivi")
.HasColumnType("datetime2");
…
});
#pragma warning restore 612, 618
}
}
}
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
Executed DbCommand (24ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT [d].[Id], …[d].[DateSoldePr], [d].[DateSuivi], …
FROM [Developers] AS [d]
We didn't see RAF column.
I suppose that it's not a good idea to put this calculation in Developer.cs
I propose to to you github link here : WebApp3B