Adding an interface to a partial class

前端 未结 3 648
抹茶落季
抹茶落季 2020-12-31 08:05

I have a class that is generated by a third party tool:

public partial class CloudDataContext : DbContext 
{
    // ...SNIPPED... 
    public DbSet

        
3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-31 08:49

    Here's a quick checklist. Do the classes have identical:

    • Names?
    • Namespaces?
    • Access modifiers?

    Example:

    • You decide to split an existing class into two files.
    • The original file's namespace doesn't match its folder path.
    • Consequently, the new class file you create has a mismatching namespace.
    • Build fails.

提交回复
热议问题