「Fluent NHibernate/フルーエントマッピング/NOT NULL」の版間の差分
imported>Administrator ページの作成:「Fluent NHibernateで「'''NOT NULL'''」を用いる方法、およびその際の注意事項について。 == エンティティ == エンティティにおけ...」 |
imported>Administrator 編集の要約なし |
||
| 9行目: | 9行目: | ||
public class ForeverNote | public class ForeverNote | ||
{ | { | ||
public long Id { get; protected set; } | |||
private string _memo; | |||
public string Memo | |||
{ | |||
get { return _memo ?? "" } | |||
set { _memo = value ?? "" } | |||
} | |||
} | } | ||
| 37行目: | 37行目: | ||
{ | { | ||
public ForeverNoteMap | public ForeverNoteMap | ||
{ | |||
Id(x => x.Id) | Id(x => x.Id) | ||
.GeneratedBy.Identity(); | |||
Map(x => x.Memo) | |||
.Length(1048576) | |||
.Not.Nullable() | |||
.Default(""); | |||
} | |||
} | } | ||
</source> | </source> | ||