I have designed an abstract class for one table
namespace Test.Data
{
[Table("Parameter")]
public abstract class Parameter
{
[StringLength(200)]
protected string title { get; set; }
protected decimal? num { get; set; }
public Int16 sts { get; set; }
}
}
and have some classes extended from it (TPH) I found that when properties defined as PROTECTED, they will not generate in database and they should be public (above are protected else sts). But I would like to hide the above properties from another namespace and using different names for them, like:
namespace Test.Data
{
public class Measure:Parameter
{
[NotMapped]
public string Title { get { return ttl; } set { ttl = value; } }
}
}
namsespace Test.Model
{
public class MeasureModel:Data.Measure
{
public void AddNew()
{
var m = new Data.Measure();
m.Title="meter"; //other measure's properties shouldn't accessable here
}
}
}