MVVM Toolkit ObservableProperty Key

Quentin Samuelson 1 Reputation point
2022-06-30T03:25:07.603+00:00

I am looking at the new Code Generation in MVVM Toolkit.
I am attempting to create a database using Code First and EntityFrameworkCore.
If I use the Observable Validator I can generate a column as:

[ObservableProperty]
[Key]
[Required]
string m_CPY_ID;

But it does not recognise the KEY attribute.

I then have to generate any KEY attributes as :
private string m_CPY_ID;

    [Key]  
    [Required]  
    public string CPY_ID  
    {  
        get => m_CPY_ID;  
        set => SetProperty(ref m_CPY_ID, value);  
    }  

Is it possible to have the ObservableProperty and autogenerate the code and have a KEY value?

Regards

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
697 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,237 questions
{count} votes