I have a shared Project.Core
class library and there are
public class SomeClass
{
//properties
//methods
}
public class AnotherClass
{
//properties
//methods
}
then I have an web app (Project.Web
) and desktop app (Project.Client
) that refer the project, there I want to add some extension to SomeClass
so
public class SomeClass : Project.Core.SomeClass
{
//Extensions
}
But it cause an ambiguousness between Project.Web.SomeClass
and Project.Core.SomeClass
when there's a file that have
using Project.Core //to refer uninherited classes in the class library
using Project.Web //to refer inherited Project.Web.SomeClass
public class MyClass
{
public SomeClass SomeClass { get; set; } //Ambiguousness
public AnotherClass AnotherClass { get; set; }
}
So I have two ways: change the name in the class library to something like SomeClassCore
or change inherited classes to SomeClassWeb
and SomeClassClient
.
Which is the better choice, or is there another smart way?