-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data Annotations seems doesn't work in derived class #7007
Comments
What version of EF Core are you using? |
MySQL.Data.EntityFrameworkCore (7.0.6-IR31) |
@BigVan This should have been fixed in |
I'm getting this too - my annotations don't seem to work for SQLite, but they're fine through the fluent api. here are my dependencies:
Or am I using the wrong annotation library? I couldn't find any mention of the one to use in the documentation, but I saw Here is an example class: using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Collections.Generic;
namespace Foo.models
{
public class Foo
{
public int Id { get; set; }
[Required, MaxLength(512)]
public string Name { get; set; }
}
} |
This is a known issue: data annotations don't work on UWP, see #5471 |
Hi~
When I am using EF core to create
MySQL
table(using MySQL.Data.EntityFrameworkCore Package)
, I found some problems that Data Annotations[Column( TypeName = "varchar(200)" ]
seems doesn't work.Steps to reproduce
Here is my code:
When the database created, the type of column 'Description' is still varchar(255).
However, when I use 'Fluent API' as follow:
It can change the column type to varchar(200).
So, Is this a bug ?
Further technical details
Visual studio version: 2015-community update3
The text was updated successfully, but these errors were encountered: