c# - Entity Framework does the data type effect the behavior of PropertyConfiguration methods? -


assuming

public int? count { get; set; } 

are following 2 statements equal?

property(v => v.count).hascolumnname("count"); property(v => v.count).hascolumnname("count").isoptional(); 

does hold true complex data types, say:

public foo bar { get; set; }  property(v => v.prop1).hascolumnname("prop1"); property(v => v.prop1).hascolumnname("prop1").isoptional(); 

in first case, yes, 2 statements equal in terms produce same ddl.

in second case, if foo complex type, means bar navigation property. , should treat navigation properties differently in configuration, eg:

hasrequired(x => x.bar).withmany().hasforeignkey(x => x.barid) 

or

hasoptional(x => x.bar).withmany().hasforeignkey(x => x.barid) 

depending on intended relationship.


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -