예제 #1
0
        public EntityBuilder Entity(string @namespace, string name)
        {
            @namespace.ThrowIfNullOrWhitespace(nameof(@namespace));
            name.ThrowIfNullOrWhitespace(nameof(name));
            DefaultNamePattern.ThrowIfDoesNotMatch(@namespace, nameof(@namespace));
            DefaultNamePattern.ThrowIfDoesNotMatch(name, nameof(name));

            if (_entityBuilders.Any(tf => tf.DefinesEntity(@namespace, name)))
            {
                throw new InvalidOperationException($"Entity \"{@namespace}.{name}\" already exists.");
            }

            var entityBuilder = new EntityBuilder(this, @namespace, name);

            _entityBuilders.Add(entityBuilder);
            return(entityBuilder);
        }
예제 #2
0
 public PrimaryKeyPropertyBuilder(EntityBuilder entityBuilder, int ordinal, string name)
     : base(entityBuilder, ordinal, name)
 {
 }
예제 #3
0
 internal PropertyBuilderBase(EntityBuilder entityBuilder, int ordinal, string name)
 {
     _entityBuilder = entityBuilder;
     Ordinal        = ordinal;
     Name           = name;
 }