All Questions
Tagged with mapping fluent-nhibernate
183
questions
0
votes
1
answer
17
views
FluentNHibernate: how to map elements of a list
I have the following classes:
public abstract class AbstractGeometry : IGeometry
{
// something
}
public class CompositeGeometry : AbstractGeometry
{
IGeometry MainGeometry { get; set; }
...
0
votes
1
answer
82
views
Map property whith where condition
I have one table for 3 entities:
Password, Note, Credit Card.
The table has an "EntityType" column.
For example, for the password there is the value "P".
How do I make Mapping so ...
0
votes
1
answer
68
views
Mapping interface using FluentNhibernate and Autofac
i'm have a hard and extreming question, how i'm may using FluentNHibernate for mapping a interface? follow a example below how i'm imagine do:
I'm have a interface:
public interface IUser
{
...
2
votes
1
answer
4k
views
Auto Increment (Identity) does not work in Fluent NHibernate
I'm using Fluent Nhibernate.
Mapping class looks following:
public class CategoryMap : ClassMap<Category>
{
public CategoryMap()
{
Id(x => x.CategoryId).UniqueKey("...
1
vote
1
answer
130
views
NHibernate: One-to-many
I have a class called DadosvalmetSam (Parent) which have a one-to-many relationship with DadosfuncionarioSam(Child).
Classes and mapping below:
DadosvalmetSam
public class DadosvalmetSam
{
...
0
votes
2
answers
318
views
Self referencing entity in NHibernate gives object references an unsaved transient instance exception
I have a self referencing entity named Category.
A category may have one or more child categories. A category may also have no childs.
I have made the entity and mapping but I keep getting this ...
0
votes
1
answer
97
views
Save parent with children in one query ( children have null value reference for parent)
Good day. I can't save parent with children in same query. But children have null reference for parent...
Parent in my DB is table "food_in_the_cart" and model for it is here:
public class ...
0
votes
1
answer
82
views
Fluent nhibernate Automaping by property name
Is there a way to map properties of an entity automatically to column names (without code)
Class Person
{
public int ID{get;set;}
public string NAME {get;set;}
}
What I would like is to map this ...
1
vote
1
answer
946
views
Add custom columns on many to many relationship on NHibernate
I have a movie entity and a actor entity, these 2 entities have a many to many relationship, so I've mapped it as ManyToMany(x=>x.Movies) and ManyToMany(x=>x.Actors) but i'd like to have the character ...
1
vote
1
answer
1k
views
FluentNHibernate Formula Mapping C#
Is there a way to declare a map passing a Formula which will run just for a specific statement (SELECT in my case)?
The problem is that I have something like
Map(x => x.Id).Formula("SUBSTRING(id, ...
0
votes
1
answer
2k
views
Fluent NHibernate HASMANY mapping without references
I am a beginner at using Fluent NHibernate.
I am developing a C# application that has to interact with an existing database.Let say I have 2 tables: Items and ItemsList.
Items: ID INT ...
1
vote
1
answer
145
views
Fluent NHibernate Create entity mapping for overlapping entities
For eg. I have two tables in my database
NonResidentStudents - columns studentID, studentname, ModeOfTransport
ResidentStudents - columns studentID, studentname, DateOfJoiningHostel
studentID and ...
0
votes
2
answers
475
views
Fluent nhibernate m-to-m mapping with external table
I have two tables in Oracle
Entity
----------
**EntityId** NUMBER(9), **EntityName** VARCHAR2
EntityLinks
--------------
**EntityLinkId** NUMBER(9),**ParentEntityId** NUMBER(9), **ChildEntityId** ...
1
vote
1
answer
53
views
FluentNhibernate Cascading - Not Saved Parent Id [closed]
I have a problem with my fluent nhibernate.
My Codes,
BaseEntity:
public abstract class BaseEntity : IEntity<BaseEntity, int>, IDisposable
{
public virtual int Id { get; set; }
...
3
votes
1
answer
80
views
How can i set a Column in a CompositeId mapping with NHibernate
I have one Composite Id map with NHibernate and I want to set a column in all those Id's. Is that possibel?
public class MapProduction : ClassMap<Production>
{
public MapProduction()
{
...