huwred
09/04/2023, 1:14 PMcsharp
[TableName(TableConstants.Questions.TableName)]
[ExplicitColumns]
[PrimaryKey("Id", AutoIncrement=true)]
public class Question
{
[Column("Id")]
[PrimaryKeyColumn(AutoIncrement = true)]
public int Id { get; set; }
[Column("Name")]
public string Name { get; set; }
[Column("Responses")]
public int ResponseCount { get; set; }
[Column("StartDate")]
[NullSetting(NullSetting = NullSettings.Null)]
public DateTime? StartDate { get; set; }
[Column("EndDate")]
[NullSetting(NullSetting = NullSettings.Null)]
public DateTime? EndDate { get; set; }
[Column("CreatedDate")]
public DateTime CreatedDate { get; set; }
[Ignore]
public IEnumerable<Answer> Answers { get; set; }
[Ignore]
public IEnumerable<Response> Responses { get; set; }
}
I am executing Create.Table<Question>().Do();
but it does not set the datetime fields to allow nullsJemayn
09/04/2023, 1:40 PMhuwred
09/04/2023, 1:41 PMJemayn
09/04/2023, 1:42 PM[NullSetting]
public DateTime? ClosingDate { get; set; }
Don't know if making the type nullable has any effecthuwred
09/04/2023, 1:48 PMcsharp
[Column("EndDate")]
[NullSetting(NullSetting = NullSettings.Null)]
public DateTime? EndDate { get; set; }
huwred
09/04/2023, 2:24 PMAmbert
09/04/2023, 4:12 PMhuwred
09/04/2023, 4:26 PM[NullSetting(NullSetting = NullSettings.Null)]
which didn't work, just using` [NullSetting]` doesAmbert
09/08/2023, 5:11 AMhuwred
09/29/2023, 8:01 AMnl_05
09/29/2023, 8:02 AMhuwred
09/29/2023, 8:03 AMnl_05
09/29/2023, 8:04 AM