/// <summary>
 /// Defines the data entity type primary property (via <see cref="Field"/> object).
 /// </summary>
 /// <param name="field">The instance of <see cref="Field"/> object to be mapped.</param>
 /// <param name="force">A value that indicates whether to force the mapping. If one is already exists, then it will be overwritten.</param>
 /// <returns>The current instance.</returns>
 public EntityMapFluentDefinition <TEntity> Primary(Field field,
                                                    bool force)
 {
     PrimaryMapper.Add <TEntity>(field, force);
     return(this);
 }
 /// <summary>
 /// Defines the data entity type primary property.
 /// </summary>
 /// <param name="expression">The expression to be parsed.</param>
 /// <param name="force">A value that indicates whether to force the mapping. If one is already exists, then it will be overwritten.</param>
 /// <returns>The current instance.</returns>
 public EntityMapFluentDefinition <TEntity> Primary(Expression <Func <TEntity, object> > expression,
                                                    bool force)
 {
     PrimaryMapper.Add <TEntity>(expression, force);
     return(this);
 }
 /// <summary>
 /// Defines the data entity type primary property (via property name).
 /// </summary>
 /// <param name="propertyName">The name of the class property to be mapped.</param>
 /// <param name="force">A value that indicates whether to force the mapping. If one is already exists, then it will be overwritten.</param>
 /// <returns>The current instance.</returns>
 public EntityMapFluentDefinition <TEntity> Primary(string propertyName,
                                                    bool force)
 {
     PrimaryMapper.Add <TEntity>(propertyName, force);
     return(this);
 }
示例#4
0
 protected IPrimaryOptions <T> Primary(Expression <Func <T, object> > expression)
 {
     PrimaryMapper.Add <T>(expression);
     return(new PrimaryOptions <T>(expression));
 }