protected override void ApplyTypeRestrictions(BedValueHolder holder, DbTypeBase type, ILogger logger) { base.ApplyTypeRestrictions(holder, type, logger); var dtype = type as DbTypeDatetime; var htype = holder.GetFieldType(); if (dtype != null && htype != TypeStorage.DateTime) { var val = holder.GetDateTimeValue(); if (dtype.GetSpecificAttribute("mssql", "subtype") == "datetime2" && m_dialect.Version.Is_2008()) { val.MakeRestriction(m_mindatetime2, m_maxdatetime2); } else if (dtype.GetSpecificAttribute("mssql", "subtype") == "smalldatetime") { val.MakeRestriction(m_minsmalldatetime, m_maxsmalldatetime); } else if (dtype.SubType == DbDatetimeSubType.Time && m_dialect.Version.Is_2008()) { holder.SetString(val.TimePart.ToStringNormalized()); return; } else { val.MakeRestriction(m_mindatetime, m_maxdatetime); } holder.SetDateTime(val.AsDateTime); } }
protected override void ApplyTypeRestrictions(BedValueHolder holder, DbTypeBase type, ILogger logger) { var htype = holder.GetFieldType(); var dtype = type as DbTypeDatetime; if (dtype != null && type.GetSpecificAttribute("mysql", "subtype") == "timestamp" && htype.IsDateRelated()) { var val = holder.GetDateTimeValue(); val.MakeRestriction(m_mintimestamp, m_maxtimestamp); val.MakeValidDate(); holder.SetDateTimeEx(val); } base.ApplyTypeRestrictions(holder, type, logger); }