Fluent API and Data Annotations
===

Do DataAnnotations do the same thing as Fluent API methods?

For example, does .HasRequired == [Required]?

.HasKey == [Key]?

Must I mark class key with [Key] or use .HasKey if I do not want my table pk field generated as ClassNameClassNameID if I am using ClassNameID format for my pk property?

Can I use a combonation of DataAnnotations and Fluent API; or, is it one or the other?

Must I map M:M relationships for both classes involved i.e.

    public class Foo
    {
        public ICollection<Bar> Bars
    }

    public class Bar
    {
        public ICollection<Bar> Foos
    }

    public class Context : DbContext
    {
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Foo>()
                .HasMany(f => f.Bars).WithMany(b => b.Foos)
                .Map(t =>
                    {
                        t.MapLeftKey("FooID");
                        t.MapRightKey("BarId");
                        t.ToTable("FooBar");
                    });

             modelBuilder.Entity<Bar>()
                .HasMany(b => b.Foos).WithMany(f => f.Bars)
                .Map(t =>
                    {
                        t.MapLeftKey("FooID");
                        t.MapRightKey("BarId");
                        t.ToTable("FooBar");
                    });
    }
        
Thanks.