You can do it in the mapping like this:

<property name="SomeProperty">
    <column default="myValue" />
</property>

Be aware that this doesn't actually create default values for your C#
objects. You will need to still do that the traditional way:

public class MyEntity
{
    private string _someProperty = "myValue";

    public string SomeProperty
    {
          get { return _someProperty; }
          set { _someProperty = value; }
    }
}

On Oct 14, 12:58 am, mynkow <myn...@gmail.com> wrote:
> Hi folks,
>
> I have a mapping files and I create my database from the mappings. The
> database has Default value field which I want to populate but NHib
> looks like does not support this. Can you help me how can I set
> default values of my properties? It is not necessary to do it in the
> database but in the mapping. The only thing that I do not want is to
> set default values in the c# code within the entities.
>
> 10x
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to nhusers@googlegroups.com
To unsubscribe from this group, send email to 
nhusers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to