HasMany And Protected Fields

Original Post joelowrance's Avatar

joelowrance

08 Jun, 2010 02:06 AM via web

Sorry if this has been asked to death -- I'm really not sure what terms I should be searching on...

What I'd like to do is

public class Project : Entity
{
    public virtual string Name { get; set; }
    protected virtual IList<Task> Tasks { get; set; }
    ...`

But it seems like my only option (at least with my very limited understanding) is to set the Tasks field to public.

My automapping model setup looks like this

         var model = AutoMap.AssemblyOf<Project>()
           .IgnoreBase<Entity>()
           .Where(t => t.Namespace == "TaskTracker.Core" && t.IsSubclassOf(typeof(Entity)))
           .Conventions.Add(PrimaryKey.Name.Is(x => "Id"),
                            DefaultLazy.Always(),
                            DefaultCascade.SaveUpdate(),
                            ForeignKey.EndsWith("Id"),
                            Table.Is(x => x.EntityType.Name));

`

Is there something I can set in there to say that my collections will always be set via protected fields?

Thanks for any help or pointers,
Joe

    Reply to this discussion

    Preview Comments are parsed with Markdown. Help with syntax

    Attached Files

      You can attach files up to 10MB

      What is the opposite of bad?

      Recent Discussions

      05 Jul, 2010 10:29 PM
      05 Jul, 2010 12:45 PM
      05 Jul, 2010 12:42 PM
      05 Jul, 2010 12:17 PM
      05 Jul, 2010 12:12 PM

       

      03 Jul, 2010 12:26 AM
      02 Jul, 2010 02:17 PM
      02 Jul, 2010 08:18 AM
      02 Jul, 2010 12:20 AM
      01 Jul, 2010 10:14 PM