C#C
C#10mo ago
morry329#

✅ the type or namespace name 'ListingProjects' does not exist in the namespace models

So I don't understand why my code has been getting this message.
It started when I added a new attribute to my model class in my CRUD app like this

public class ListingProjects_ver2 //I renamed the model class name as well 
{
    
    [System.ComponentModel.DataAnnotations.Key]
    [Required]
    public int? Id { get; set; } // Primary key for DTO
    
    [Required]
    public string? ListingName { get; set; } 

    [Required]
    [NotMapped]
    public IFormFile? ListingImage { get; set; } //this is the attribute I added 
}


My CRUD lets me create/delete/read my data out of my db, but only the edit operation fails. It does not save my edits as per screenshot

My debug shows this message the type or namespace name 'ListingProjects' does not exist in the namespace models (are you missing a reference)

Could anyone kindly point me in the direction to resolve this bug?
Screenshot_2025-03-15_alle_21.57.14.png
Was this page helpful?