Question: I have the folowing class and controller (mvc)

UI Model inherits DB model (ef4.0)

```
public class RegistrationModel : Model.User
    {
        [Required]
        public string PasswordText { get; set; }
    }   

```

MVC controller

```
    public ActionResult Create(RegistrationModel registrationModel)
            {
                try
                {
                    Context ctx = new Context();
                    Model.User user = new Model.User();
                    user = (registrationModel as Model.User);
                    user.Password = System.Text.ASCIIEncoding.ASCII.GetBytes(registrationModel.PasswordText); //do encryption later on
...
                    ctx.Customer.Add(registrationModel as Model.User);
                    ctx.SaveChanges();
                }
    }

```

when i cast the registrationmodel to a user the type remains registrationmodel is there a way to cast it, without copying all its properties to a new user object?

```
                Model.User user = new Model.User();
                user.Active = registrationModel.Active;
                user.Blocked = registrationModel.Blocked;
//...

```

....

Answer: 
As noted in the comments ConventionBuilder.Property.Always(x => x.Column(x.Property.Name)) was adding the column to all properties (and overriding the formula).

Adding .Columns.Clear() to the mapping should remove the column, so:

```
mappings.Override<Business>(map =>
{
    map.IgnoreProperty(x => x.IsNewRecord);
    map.IgnoreProperty(x => x.IdString);
    map.Map(x => x.UserPassword).CustomType<EncryptedStringType>();
    map.Map(x => x.HasTakenSurvey).Formula(SURVEY_FORMULA).Not.Insert().Not.Update().Columns.Clear();
    map.Map(x => x.Votes).Formula(VOTES_FORMULA).Not.Insert().Not.Update().Columns.Clear();
});

```
Columns.Clear() solution provided by @david duffet also didn't work for me. The getter of Formula is private and so you can't filter on the Formula property (you get method-group cannot be converted to value or something like that). NH3.3, FNH 1.3.

My solution - create a custom Attribute in my Model project - IsNHibernateFormulaPropertyAttribute, apply it to my formula properties, and then check for that attribute in my naming convention logic using reflection:

```
private bool IsFormula(IPropertyInstance instance)
{
    var propInfo = instance.Property.DeclaringType.GetProperty(instance.Property.Name);
    if (propInfo != null)
    {
        return Attribute.IsDefined(propInfo, typeof(IsNHibernateFormulaPropertyAttribute));
    }

    return false;
}
public void Apply(IPropertyInstance instance)
    {
        if (!IsFormula(instance))
        {
            instance.Column(Convert(instance.Property.Name));
        }
    }

```