Ejemplo n.º 1
0
        //■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■

        internal static PropertyBuilder <string> ConfigureProperty(this EntityTypeBuilder builder, IMutableProperty property)
        {
            var newProperty = builder.Property <string>(property.Name.Replace(TranslationAnnotationNames.Prefix, string.Empty)).Metadata;

            foreach (var item in property.GetAnnotations())
            {
                newProperty.SetAnnotation(item.Name, item.Value);
            }

#pragma warning disable EF1001 // Internal EF Core API usage.
            return(new PropertyBuilder <string>(newProperty).IsRequired(!property.IsNullable));

#pragma warning restore EF1001 // Internal EF Core API usage.
        }
Ejemplo n.º 2
0
 private static bool NoneAnnotationDateTime(IMutableProperty property)
 {
     return((property.ClrType == typeof(DateTime) || property.ClrType == typeof(DateTime?)) &&
            !property.GetAnnotations().Any());
 }